[英]How to restore files deleted by git pull rebase
something quite tragic happened to all my files in my project after I did a git pull rebase
. 在我执行
git pull rebase
后,我的项目中的所有文件都发生了非常悲惨的事情。 I tried to follow the tips in this thread: 我尝试遵循此线程中的提示:
Git pull deleted uncommitted changes Git pull删除未提交的更改
especially the second solution and I have been trying this: 特别是第二种解决方案,我一直在尝试:
grep -rin string_in_missing_file .git/
I see results in the terminal like this: 我在终端中看到这样的结果:
.git//rebase-apply/0002:9609:+const ExplainSection = styled.div`
.git//rebase-apply/0002:9614:+const SectionNumber = styled.div`
.git//rebase-apply/0002:9621:+const SectionImage = styled.div`
.git//rebase-apply/0002:9626:+const SectionText = styled.div`
It seems that info about my files are still floating around somewhere, but I have no idea how to restore them, or if it is even still possible. 似乎有关我的文件的信息仍然在某个地方浮动,但是我不知道如何还原它们,甚至还无法恢复。
Please help me out here :( 请在这里帮助我:(
Check git reflog
so you can see where HEAD has been recently. 检查
git reflog
以便您可以查看HEAD最近的git reflog
。 That way you could go as far as to get the branch reset to where it was before. 这样,您可以将分支重置到以前的位置。 As long as those files where committed, you won't lose them that easily.
只要提交了这些文件,您就不会轻易丢失它们。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.