문제

I was working in default, but thought to be working in another branch. I commited, but didn't push.

Now I want to change branches and commit the changes to another branch, but also dont want the commit to go to default.

How do I undo that commit?

도움이 되었습니까?

해결책

If you are still in the draft phase (not pushed elsewhere yet), use the built-in extension hg strip <rev> command. Otherwise, you should do a hg backout, which will reverse the changeset.

In case you still need the commit you made, I suggest you export it to import it again in the correct branch, before stripping.

다른 팁

If "another branch" already exist, you must move changeset to it, using hg rebase (rebase extension have to be enabled)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top