Git / detached HEAD, get work back?
问题 I made a dozens of commits on what I thought was my branch, then checked out another branch. Willing to go back to my initial branch, I didn't find my updated code. After looking at my history in console, I understood I worked in a detached branch... Is it somehow possible to get the job I've done on the detached branch? 回答1: Yes. You can use the reflog. Try git log -g HEAD . This will show you the reflog for HEAD , i.e. every single commit that HEAD has pointed to, and the reason why it