And previously, I tried to experiment with my program and then, I feel like going back (checkout) to previous commit. Then, I changed something, committed.. etc..
The question is, How do I go back to the state before I checkout.
I know I could git checkout the-hash,
But I don’t know the-hash.
git log only show history until the current state.
Thanks.
Take a look at the output of
git reflog. Look for the checkout, then do agit checkout HEAD@{X}where X is the number thatgit reflogshows on the line after that checkout.