记录一次git的误删除操作--恢复

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了记录一次git的误删除操作--恢复相关的知识,希望对你有一定的参考价值。

 git commit之后想撤销重来一次,就执行了git reset操作,但是加个--hard参数,git reset --hard 把所有提交的文件都删除了,尝试了git reflog show和git reset [email protected]{x}等操作均无效。

 最终的解决办法是:

git ls-files -d | xargs git checkout --

说明:

git ls-files - Show information about files in the index and the working tree

-d, --deleted

           Show deleted files in the output


本文出自 “Jason'blog” 博客,请务必保留此出处http://xujunxian.blog.51cto.com/8614409/1859015

以上是关于记录一次git的误删除操作--恢复的主要内容,如果未能解决你的问题,请参考以下文章