Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
不确定是否有解决方案:
我不小心上演了一个目录:
git add *
然后,看到这个,我做到了(重大,重大错误,当然应该没有上演)
git rm -r my_directory
最重要的是,我跟进了:
git commit -m ¨horrible commit¨
现在找不到文件了。有没有办法恢复文件?
谢谢
如果我没记错的话, git rm 不应该删除这个目录而是抱怨:
error: the following file has changes staged in the index: my_directory (use --cached to keep the file, or -f to force removal)
所以目录应该仍然存在......
如果您使用 -f 运行它,对不起,那么我想您无能为力。