有没有办法恢复或撤消git pull,以便我的源/ repos将进入git pull之前的旧状态?我想这样做是因为它合并了一些我不想这样做的文件,但只合并了其他剩余的文件.所以,我想要恢复这些文件,这可能吗?谢谢 :)
编辑我想撤消git merge以澄清.看到一些答案后,我就这样做了
git reflog
bb3139b... HEAD@{0}: pull : Fast forward
01b34fa... HEAD@{1}: clone: from ...name...
Run Code Online (Sandbox Code Playgroud)
现在,我该怎么办?做的git reset --hard 还行吗?我不想再把它搞砸了,所以要求详细的步骤?
我从github分叉了一个项目,原点指向我自己的github仓库,远程指向它的原始仓库,因为我想从远程获取更新,
我使用git pull remote branch_name,然后我的本地repo处于冲突模式,现在我想取消git pull的效果,所以我使用git stash,但是很惊讶地发现我没有这样做?怎么了?
详细信息如下:
[mirror@home weechat]$ git status
# On branch master
# Unmerged paths:
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
# both modified: CMakeLists.txt
# both modified: ChangeLog
# both modified: NEWS
# both modified: configure.in
# both modified: po/cs.po
# both modified: po/de.po
# both modified: po/es.po
# both modified: po/fr.po
# both modified: po/hu.po
# both modified: po/ru.po
# both modified: po/weechat.pot
# deleted by us: src/irc/irc-server.c
# …Run Code Online (Sandbox Code Playgroud) 运行“git stash”时出现此错误
Cannot save the current status
Run Code Online (Sandbox Code Playgroud)
没有其他信息。
这是为什么?
在极少数情况下,git pull将在我们的网站上引起问题,我需要快速回顾时间,以便开发人员可以解决问题。我已经尝试过了,git reset HEAD@{1}但是由于某些文件仍在更改,因此无法解决问题。好像它只回滚一些文件。
我可以调用一个命令来可靠地还原最近git pull命令之前的文件吗?