How do I revert `git fetch upstream; git merge upstream/master`?
This question already has an answer here:
Since you have an actual merge commit--because you've been introducing your own changes--you should be able to do:
git reset --hard HEAD~1
Assuming your last commit was the merge commit in question.
You can reset your local master
branch to the origin/master
state (if you haven't push your merge to origin/master
) with :
git reset --hard origin/master
If that's not possible you can use the reflog :
git reflog
You can see undoing a git rebase for more details
链接地址: http://www.djcxy.com/p/16966.html上一篇: 如何撤消主分支的合并?