Within my master branch, I did a git merge some-other-branch
locally, but never pushed the changes to origin master. I didn\'t mean to merge, so I\'d like to un
If you notice that you need to revert immediately after the merge and you haven't done anything else after the merge attempt, you can just issue this command:
git reset --hard HEAD@{1}
.
Essentially, your merge sha
will be pointing to HEAD@{0}
if nothing else was committed after the merge and so HEAD@{1}
will be the previous point before the merge.