I wrote some code after the last commit. After that, I accidentally did git reset --hard. My code rolled back to the last commit.
Can I restore uncommitted changes?
I wrote some code after the last commit. After that, I accidentally did git reset --hard. My code rolled back to the last commit.
Can I restore uncommitted changes?
Generally speaking, no. The data is not preserved in the file system; an end user cannot recover it.
However, git
doesn't go out of its way to eradicate it, so a data recovery expert might be able to find some (or all) of it.