In CVS, sometimes I do “replace with the latest from head” to abandon local changes to a file as the local changes might be messed up and one would like to start afresh with that file, while keeping any uncommitted local changes made to other files. How to do the equivalent in Mercurial and Git?
Share
For Mercurial, use
hg revert. Seehg help revert.Edit
To clarify,
hg revertchanges files to a previous revision.hg updatechanges the parent changeset to a different revision. In both cases, uncommitted changes are preserved unless-Cis used.