简体   繁体   English

如何恢复 git lost and found 文件夹中的文件

[英]How to recover files in git lost and found folder

I used git reset --hard without any commits yet.我使用git reset --hard没有任何提交。 I got this link on stackoverflow Undo git reset without any commits yet and I was able to get some files in the .git lost-found folder.我在 stackoverflow Undo git reset上得到了这个链接, 但没有任何提交,我能够在 .git lost-found 文件夹中获取一些文件。

But the file are dangling blob which I cant work on.但是该文件是我无法处理的悬空 blob。 they are just plain.它们很简单。

How do I get these files back to original form thanks我如何将这些文件恢复为原始形式谢谢

I've experienced the lost of files that weren't committed too, and the only solution to retrieve them is not to rely on git, but rather on anything else that can cancel the action of deleting the files.我也遇到过未提交的文件丢失的情况,检索它们的唯一解决方案不是依赖 git,而是依赖任何其他可以取消删除文件操作的操作。

In my case, cancelling the actions (by that I mean CMD+Z) on my IDE restored the files (I was using RubyMine).就我而言,在我的 IDE 上取消操作(我的意思是 CMD+Z)恢复了文件(我使用的是 RubyMine)。

Good luck!祝你好运!

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

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