How to recover after i execute :git reset --hard HEAD

后端 未结 6 805
梦如初夏
梦如初夏 2020-12-31 11:37

I made a terrible mistake and execute \"git reset --hard HEAD\", all day\'s the local modification lost, how can i recover it?

Thanks millions

6条回答
  •  没有蜡笔的小新
    2020-12-31 12:18

    You can recover anything you git added, with git fsck --lost-found and poke around in .git/lost-found. find .git/objects -type f | xargs ls -lt | sed 60q will give you the last 60 things to get added to the repo, that'll help.

    Anything you didn't git add is gone as surely as if you'd deleted it yourself.

提交回复
热议问题