0

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?

Konstantin
  • 35
  • 1
  • 5
  • Possible duplicate of [How can I undo git reset --hard HEAD~1?](https://stackoverflow.com/questions/5473/how-can-i-undo-git-reset-hard-head1) – phd Feb 06 '19 at 11:55
  • https://stackoverflow.com/search?q=%5Bgit-reset%5D+undo+hard+reset – phd Feb 06 '19 at 11:55

1 Answers1

0

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.

Amadan
  • 191,408
  • 23
  • 240
  • 301