Git undo merge attempt

git merge --abort might be what you're looking for.


Modern Git:

git merge --abort

Older:

git reset --merge

Old-school (warning: will discard all your local changes):

git reset --hard

But actually, it is worth noticing that git merge --abort is only equivalent to git reset --merge given that MERGE_HEAD is present. This can be read in the git help for merge command.

git merge --abort is equivalent to git reset --merge when MERGE_HEAD is present.

After a failed merge, when there is no MERGE_HEAD, the failed merge can be undone with git reset --merge but not necessarily with git merge --abort, so they are not only old and new syntax for the same thing. Personally I find git reset --merge much more useful in everyday work.


With Git 2.10 (Q3 2016), you will know what to do, because git status will propose the git merge --abort option.

See commit b0a61ab (21 Jul 2016) by Matthieu Moy (moy).
(Merged by Junio C Hamano -- gitster -- in commit 5a2f4d3, 03 Aug 2016)

status: suggest 'git merge --abort' when appropriate

We already suggest 'git rebase --abort' during a conflicted rebase.
Similarly, suggest 'git merge --abort' during conflict resolution on 'git merge'.