开发者

How to remove changes in a file in hg

开发者 https://www.devze.com 2022-12-29 05:16 出处:网络
开发者_开发问答Can you please tell me how can I remove change I madelocally? In git , I can do git checkout -- aFile.cpp, how can I do the same thing with hg?hg revert <filename>

开发者_开发问答Can you please tell me how can I remove change I made locally?

In git , I can do git checkout -- aFile.cpp, how can I do the same thing with hg?


hg revert <filename>

More detail on available hg commands is available on the man page.

(Note that this is not the same as git revert - git's revert command is for reverting commits, hg's revert command is for reverting local changes. Also, the command you should really be using to remove local changes in git is actually git reset, not checkout.)


revert --no-backup

Prevents the creation of .orig files, more closely emulating git checkout:

hg revert --no-backup file

See also: How do you disable mercurial from leaving .orig files after a merge?

0

精彩评论

暂无评论...
验证码 换一张
取 消