How to revert last commits and keep changes in mercurial?

后端 未结 2 800
失恋的感觉
失恋的感觉 2021-02-13 13:46

I have three commits 1, 2 and 3. How can I rollback 2 and 3 and still keep the changed files of them??

1---2---3

=> 1 and changed files of 2 and 3

2条回答
  •  Happy的楠姐
    2021-02-13 14:21

    If you use TortoiseHg, you can achieve this like that:

    1. Enable strip extension from Settings -> Extensions
    2. Give Strip... command from -> 'Modify History' -> 'Strip'.
    3. Check Do not modify working copy during strip (-k/--keep) option.
    4. Click Strip button.

提交回复
热议问题