Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何恢复GIT中的最后一次合并_Git_Github_Git Gui - Fatal编程技术网

如何恢复GIT中的最后一次合并

如何恢复GIT中的最后一次合并,git,github,git-gui,Git,Github,Git Gui,我将我的更改提交给本地master,我将我的更改与另一个开发人员的作品合并,她也在master上工作,在我提交之前她很少提交。最后,我将我的工作合并到她的工作中,现在碰巧我的提交在存储库中重写了她的更改。我可以恢复合并吗 o - bad merge here that I want to get rid off |\ | o her commit 1 yesterday | o her commit 2 yesterday | o her commit 3 yesterday o | my co

我将我的更改提交给本地master,我将我的更改与另一个开发人员的作品合并,她也在master上工作,在我提交之前她很少提交。最后,我将我的工作合并到她的工作中,现在碰巧我的提交在存储库中重写了她的更改。我可以恢复合并吗

o - bad merge here that I want to get rid off
|\
| o her commit 1 yesterday
| o her commit 2 yesterday
| o her commit 3 yesterday
o | my commit today
\ |
 o

您只需使用git reset将主分支向后移动一步即可(请参阅),其中在当前提交之前标识提交(即您标记为“my commit today”的提交)。 之后,您可以查看,以获取有关如何防止覆盖更改的更多信息。

签出。