git checkout - lost all commits except for the initial commit

时间:2018-06-04 17:39:54

标签: git

I have done a refactoring and commited it. I have added a comment and remembered that I wanted to check that something did not change in the refactoring. I executed

git stash

so that I could return to the last commit and executed

git checkout HEAD~

and got (as expected) to the last commit, which was one ahead of origin.

When I wanted to return to the most recent commit I executed

git checkout master

When I now open gitk, the history is empty, only the initial commit remains. gitk claims both master and origin/master were at this only commit.

I have not executed any git commands other than gitk and git status in between.

I am lost. How do i get back to the most recent commit?

I am using git version 2.1.4.

0 个答案:

没有答案