Jesper Noehr

Pythonista, RESTafarian, Binary Poet & Proud Bucketeer

Archive for the ‘mercurial’ tag

Mercurial powertip: Un-add a file

without comments

Something that isn’t entirely clear from the use of Mercurial, is how to un-add a file you accidentally added, before you commit.


$ hg add data/
adding data/index.txt
adding data/README
adding data/hugefile.db

$ hg status
A data/index.txt
A data/README
A data/hugefile.db

Oops. Didn’t want to add ‘hugefile.db’. How to undo that add?


$ hg revert data/hugefile.db

Did that do the right thing?


$ ls data/hugefile.db # still there?
data/hugefile.db

$ hg status
A data/index.txt
A data/README
? data/hugefile.db

Yep!

Written by jespern

March 2nd, 2009 at 10:04 am

Posted in hg

Tagged with ,