git commit之后想撤销重来一次,就执行了git reset操作,但是加个--hard参数,git reset --hard 把所有提交的文件都删除了,尝试了git reflog show和git reset HEAD@{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
转载于:https://blog.51cto.com/xujpxm/1859015