Mercurial — revert back to old version and continue from there

前端 未结 7 1008
挽巷
挽巷 2020-11-27 09:05

I\'m using Mercurial locally for a project (it\'s the only repo there\'s no pushing/pulling to/from anywhere else).

To date it\'s got a linear history. However, the

相关标签:
7条回答
  • 2020-11-27 09:51

    I just encountered a case of needing to revert just one file to previous revision, right after I had done commit and push. Shorthand syntax for specifying these revisions isn't covered by the other answers, so here's command to do that

    hg revert path/to/file -r-2
    

    That -2 will revert to the version before last commit, using -1 would just revert current uncommitted changes.

    0 讨论(0)
提交回复
热议问题