How to remove changes to a file in hg

Could you tell me how can I delete the changes that I made locally? In git, I can do git checkout -- aFile.cpp , how can I do the same for "hg"?

Thank.

+55
mercurial
04 '10 at 2:07 a.m.
source share
2 answers
 hg revert <filename> 

More information on the available hg commands is available on the page.

(Note that this is not the same as git revert - the git revert command for returning collisions, the hg revert command is for returning local changes. Also, the command you really should use to remove local changes in git is actually git reset , not check.)

+70
May 04 '10 at 2:09 a.m.
source share

revert --no-backup

Prevents the creation of .orig files, more accurately imitating git checkout :

 hg revert --no-backup file 

See also: How to disable mercurial after exiting .orig file after merging?

0
07 Oct '16 at 2:26
source share



All Articles