在没有历史记录的 git rm 之后恢复文件

recover file after git rm with no previous history

不确定是否有解决方案:

我不小心上演了一个目录:

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,抱歉,我想你无能为力了。