I have feature
branch and develop
branch and I created feature
from develop
and made changes and created pull request but, now I have some other changes need to be merged from develop as there are some other guys made changes.
So, Steps I did:
git checkout develop
git pull
git checkout feature
git merge develop (after solving some conflicts)
git push
On next day I did same above steps again as there were more commits merged to develop to keep updated my branch.
So, now I want to revert/reset my feature branch without those merged from develop changes but, I couldnt find the way.
I did git log
and git reflog
to check the commits so, I can do
git reset --hard HEAD~>number>
But, now I can see there are lot of commit hash as there are many commit merged to develop branch.
How can I revert/rest those git merge develop
So, I can feature without develop merged and I cab do later on.
Any help would be greatly appreciated
CodePudding user response:
You should list recent commits in readable format limited to 7 in this command, to identify commit you need to go back to. Use this command,
git log --pretty="%C(Yellow)%h %C(reset)