简体   繁体   English

从git rebase中恢复

[英]recovering from git rebase

I have a local branch work, where I created two new files a.py, b.py and committed them. 我有一个本地分支工作,在那里我创建了两个新文件a.py,b.py并提交了它们。

Then, instead of doing "git rebase origin/master", I accidently typed "git rebase origin master", and now the commit I did is gone and the files are gone. 然后,我没有做“git rebase origin / master”,而是意外地输入了“git rebase origin master”,现在我做的提交已经消失了,文件也没了。 Does anyone know how I can recover my files? 有谁知道如何恢复我的文件?

Undoing a git rebase 撤消git rebase

Git keeps the old refs (until you clean them up). Git保留旧的参考(直到你清理它们)。 You can switch back to the old refs from before the rebase just fine. 您可以在rebase之前切换回旧的refs就好了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM