nynexman4464
nynexman4464

Reputation: 1819

How do I restore files I deleted by mistake from mercurial during an uncommitted merge?

Stupid mistake on my part, but I did a pull & merge and forgot to do a commit after the merge.

I started working with some files and deleted a folder by mistake. I tried doing hg restore on the files, but I get the error:

abort: uncommitted merge with no revision specified

and if I try to do hg ci I get:

abort: cannot commit merge with missing files

How can I restore the files so I can commit the merge and continue working?

Upvotes: 2

Views: 3152

Answers (1)

Mark Tolonen
Mark Tolonen

Reputation: 177735

Try:

hg revert <file> -r <specific_revision_to_restore>

When there is a merge in progress, Mercurial doesn't know which parent from which to restore the revision.

Upvotes: 4

Related Questions