unstaged files gone after git reset --hard

前端 未结 7 1164
清酒与你
清酒与你 2020-12-03 14:31

I tried the git reset --hard HEAD@{n} from git reflog and I lost everything with my current unstaged files :\'(

the unstaged files is the l

7条回答
  •  猫巷女王i
    2020-12-03 15:20

    If you have staged the files with git add, it can still be found back. But if the files are not staged, I have to say there's no way. :(

    Just remember that git reset is really not safe, especially for the unstaged files.

    But if the files are really really important, what I can think of is that you may stop modifying any data in your disk, and try disk recovery with the tools such as finaldata. It might find something back if lucky, because you have already overwritten some files after git reset.

    Anyway, Git is really a powerful and cool tool if you are familiar with it.

提交回复
热议问题