【发布时间】:2016-04-30 21:08:55
【问题描述】:
所以我一直在尝试恢复到我的项目的先前版本。但是当我执行 git revert 时,我不断遇到合并冲突。为什么这有道理?我说“我想恢复到以前的版本,就像当时一样”,现在它说我需要保留一些当前代码。不,我什么都不想要,我以某种方式搞砸了我的项目,并认为这个早期版本并没有搞砸。我知道我应该能够解决这些问题,但我以前从未做过大规模的合并冲突,而且我对这些 Xcode 代码也不太了解。
另外,如果我恢复提交,我是在提交之前还是之后去?比如……
提交 A、提交 B、提交 C、提交 D。
我恢复提交 B。我该去哪里?在 A 之后,还是在 B 之后?
$ git revert 8873550de2b6c4bec42cfec4e98600736f01ffb9
error: could not revert 8873550... Grid view
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
【问题讨论】:
-
git revert!=git checkout。见stackoverflow.com/questions/8358035/… -
... 或见下面的Chris's answer。