Mercurial: How do you undo changes?

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

    hg revert will do the trick.

    It will revert you to the last commit.

    --all will revert all files.

    See the link for the Man Page description of it.

    hg update is usually used to refresh your working directory after you pull from a different repo or swap branches. hg up myawesomebranch. It also can be used to revert to a specific version. hg up -r 12.

提交回复
热议问题