枫叶飞翔 发表于 2018-9-17 10:02:00

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

  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


页: [1]
查看完整版本: 记录一次git的误删除操作--恢复