icn*_*bot 43 git commit mergetool git-revert
好的,所以当我尝试恢复提交(使用Git)时,我有时会收到错误.我所做的就是
git revert <commit hash>
它给了我这样的信息:
error: could not revert <commit hash> <commit message>
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
Run Code Online (Sandbox Code Playgroud)
这是否意味着我应该使用git mergetool
并解决任何冲突?一旦我这样做,我可以添加/ rm然后提交,并恢复完成?
man*_*lds 26
是的,你将不得不解决冲突,将它们标记为有这样git add
或git rm
与git commit
提交尚未完成,git revert
如果你看到.git/MERGE_MSG,你会看到类似的东西:
还原"添加还原"
这将恢复提交c1366607f15a8384434948cb0bcbf8ece48bb460.
冲突:
还原
因此,一旦您解决了合并并执行了操作,git commit
您将看到来自MERGE_MSG文件的消息,您可以提交并完成恢复.