Is it possible to undo the changes caused by the following command? If so, how?
git reset --hard HEAD~1
This has saved my life:
https://medium.com/@CarrieGuss/how-to-recover-from-a-git-hard-reset-b830b5e3f60c
Basically you need to run:
for blob in $(git fsck --lost-found | awk ‘$2 == “blob” { print $3 }’); do git cat-file -p $blob > $blob.txt; done
Then manually going through the pain to re-organise your files to the correct structure.
Takeaway: Never use git reset --hard
if you dont completely 100% understand how it works, best not to use it.