Archive for the ‘mercurial’ tag
Mercurial powertip: Un-add a file
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!
