Difference between Revert and Update in Mercurial
Posted
by Edan Maor
on Stack Overflow
See other posts from Stack Overflow
or by Edan Maor
Published on 2010-03-24T10:21:14Z
Indexed on
2010/03/24
10:23 UTC
Read the original article
Hit count: 354
I'm just getting started with Mercurial, and I've come across something which I don't understand.
I made changes to several files, and now I want to undo all the changes I made to one of them (i.e. go back to my last commit for one specific file).
As far as I can see, the command I want is revert.
In the page I linked to, there is the following statement:
This operation however does not change the parent revision of the working directory (or revisions in case of an uncommitted merge). To undo an uncomitted merge, you can use "hg update -C -r." which will reset the parents to the first parent.
I don't understand the difference between the two (hg revert
vs. hg update -C -r
). Can anyone enlighten me as to the difference? And in my case, do I really want the revert or the update to go get rid of the changes I made to the file?
Thanks
© Stack Overflow or respective owner