2

不确定是否有解决方案:

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

git add *

然后,看到这个,我做到了(重大,重大错误,当然应该没有上演)

git rm -r my_directory

最重要的是,我跟进了:

git commit -m ¨horrible commit¨

现在找不到文件了。有没有办法恢复文件?

谢谢

4

1 回答 1

1

如果我没记错的话, 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 运行它,对不起,那么我想您无能为力。

于 2015-09-29T09:21:23.897 回答