Mercurial: How do you undo changes?

后端 未结 4 1996
遥遥无期
遥遥无期 2020-12-23 11:15

When using Mercurial, how do you undo all changes in the working directory since the last commit? It seems like this would be a simple thing, but it\'s escaping me.

4条回答
  •  攒了一身酷
    2020-12-23 11:56

    hg revert is your friend:

    hg revert --all 
    

    hg update merges your changes to your current working copy with the target revision. Merging the latest revision with your changed files (=current working copy) results in the same changes that you already have, i.e., it does nothing :-)

    If you want to read up on Mercurial, I'd recommend the very awesome tutorial Hg Init.

提交回复
热议问题