Git还原合并到特定的父项 [英] Git revert merge to specific parent
本文介绍了Git还原合并到特定的父项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个git repo,并且在恢复合并时遇到了麻烦。当前散列是0ce2ca0b35f59af267241cf4d40d16a3e13ba6f3。它有两个父母:
I have a git repo and am having trouble reverting a merge. The current hash is 0ce2ca0b35f59af267241cf4d40d16a3e13ba6f3. and it has two parents:
df1acf5f54426d30f12c6b4558c3dd922297aae3
e19b912404ffd3c153ccac3072dbf22396896d2a
执行以下操作将恢复为df1acf5f54426d30f12c6b4558c3dd922297aae3
doing the following will revert to df1acf5f54426d30f12c6b4558c3dd922297aae3
git revert -m 1 0ce2ca0b35f59af267241cf4d40d16a3e13ba6f3
如何恢复为e19b912404ffd3c153ccac3072dbf22396896d2a?
how do I revert to e19b912404ffd3c153ccac3072dbf22396896d2a?
推荐答案
git revert -m 2 0ce2ca0b35f59af267241cf4d40d16a3e13ba6f3
父母从1开始编号;你想要第二个。
Parents are numbered starting with 1; you want the second one.
这篇关于Git还原合并到特定的父项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文