How to abort a merge in mercurial?

deft_code picture deft_code · Oct 20, 2010 · Viewed 28.9k times · Source

I goofed up a merge. I'd like to revert then try again.
Is there a way to revert a merge before it is committed?

hg revert doesn't do what I'd like, it only reverts the text of the files. Mercurial aborts my second attempt at merging and complains original merge is still uncommitted.

Is there a way to undo a merge after an hg merge command but before it's committed?

Answer

Omnifarious picture Omnifarious · Oct 20, 2010

hg update -C <one of the two merge changesets>