un-add?

Matt Mackall mpm at selenic.com
Wed Apr 1 15:38:10 CDT 2009


On Wed, 2009-04-01 at 22:18 +0200, Matthieu Moy wrote:
> Aurélien Campéas <aurelien.campeas at logilab.fr> writes:
> 
> > Le Wednesday 01 April 2009 17:16:18 Neal Becker, vous avez écrit :
> >> How should I un-add a file that was added, but not yet committed?
> >>
> >> hg add x
> >> oops!
> >> now what?
> >
> > hg rm -f x
> 
> ... will remove the file x from the wworking tree. This may or may not
> be the expected result. revert, pointed out below in the thread will
> not touch the file on disk OTOH.

Indeed, revert is the 'right' answer.

Note that it's possible to get hg to remove a file (newly added or not)
without deleting it from the working directory with:

hg rm -Af file

-- 
http://selenic.com : development and support for Mercurial and Linux




More information about the Mercurial mailing list