undoing a hg addremove mistake

Roman Neuhauser neuhauser at sigpipe.cz
Fri Jan 10 04:11:30 UTC 2014


# lmergner at gmail.com / 2014-01-09 13:50:58 -0800:
> On Thu, 2014-01-09 at 11:36 -0800, Luke Mergner wrote:
> > I am trying to recover some files from my working directory (a python
> > project). Somehow using Vim, I created a file named ";".  Having forgotten
> > about it, I later "hg addremove", which added the bad file. Being clever,
> I
> > decided to remove it with hg by saying...
> >
> > $ hg remove directory/;
> 
> Thanks to both Matt and Harvey. Using revert would lose several days of
> work so I'm reluctant to do that. I'll try to revert just the lost files.

hg revert $(hg st -dn directory)

(verify that it does what you want first with 'revert -n'.


-- 
roman



More information about the Mercurial mailing list