Answer the question
In order to leave comments, you need to log in
How to recover data after git reset --hard?
did a git add. , then I did git commit, an error came out. By my stupidity I did git reset --hard. Is it possible to restore the data somehow?
Answer the question
In order to leave comments, you need to log in
Very unlikely, if you just deleted a lot of files, then it's okay, but you changed a bunch of nearby files, which most likely wiped out the previous changes on the hard.
For such cases, I have the entire working folder with repositories also in the dropbox, and some of the .git folder is also made as a separate repository :)
Try looking in the git reflog. Commits
may still be there even after git reset --hard
specifying the --hard flag makes the reset command dangerous, git actually deleted the data.
I think there are several options:
1) find a computer where there is still data left before the reset and do what you need with this data
2) try to restore the data using software
to restore from memory vm?A snapshot of the state is taken no longer than a minute. Did you do it before data destruction? If yes, roll back.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question