I commited my changes and didn't push them to the server. Then I did hard reset to one of my previous commits and my latest commit gone. Does it mean commits which weren't pushed to server gone after hard reset?
edit: Is it possible to recover my latest commit?
Yes, but not immediately. Reflog entries will expire in time and the contents will disappear on garbage collection.
You can still get them back from the reflog:
git reflog
and reset to them/checkout:
git reset HEAD@{1}
or, e.g. checking it out to a rescue branch:
git checkout -b rescue HEAD@{1}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With