如果用mercurial,只能到b分支中硬还原代码了。
git有智能的方式吗?
黄舟2017-04-22 09:02:08
"Want to restore the changed content of a from b", if you want to undo the branch merge operation, please trygit reset/revert {commit}
You can use git reflog
to check the HEAD pointer changes first, such as:
de51e3d HEAD@{0}: merge nnn: Fast-forward
4430e82 HEAD@{1}: checkout: moving from nnn to master
de51e3d HEAD@{2}: commit: commit2
4430e82 HEAD@{3}: checkout: moving from master to nnn
4430e82 HEAD@{4}: commit (initial): test
Then for example git reset HEAD@{2}
return to a certain submission
伊谢尔伦2017-04-22 09:02:08
You can directly make a new branch for the commit before merging, so nothing will be lost