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 rm -r。”?
在这里 Git SOS。我在一个项目上工作了 10 个小时而没有提交(我知道,我知道)然后我 git 添加了太多文件,所以我尝试使用 git rm 并意外删除了所有内容。我有希望吗?:(((
如果您已经提交了更改,那么:
git reset (--hard) HEAD~1
如果没有,那么:
git reset git ls-files -d -z | xargs -0 git checkout --