I know there are people having this asked already, but none provided a solution that helped me.
I use GitKraken, which obviously has no integrated functionality for checking out older commits in the history (I had to test a bit, no changes made). I now know that I should have used git checkout HEAD~n
but instead used a soft reset. So GitKraken still shows that my changes are there and come after the one I reset to. But how can I get back to my latest commit? Checking out does not work either.
I'm not sure if GitKraken just displays it wrong, but Git tells me that the commit I reset to is the current HEAD. Seems correct.
Any way I can restore the following commits or set them as HEAD?
EDIT for the duplicate tag: The referenced thread is about going back the way it's intended (which I did not do) by checking out a previous commit. Since I did a soft reset the HEAD of my master branch was not the actual latest commit anymore but the one I reset my local repository to. Using git reflog
with a reset helped to undo the actions done.