Mercurial: How do you undo changes?

后端 未结 4 2017
遥遥无期
遥遥无期 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:57

    An alternative solution to hg revert is hg update -C. You can discard your local changes and update to some revision using this single command.

    I usually prefer typing hg up -C because it's shorter than hg revert --all --no-backup :)

提交回复
热议问题