If you have ever been in a “detached head” state using Git, you might be wondering how did I get here and how do I fix this?
If you are in a ‘detached head’ state, that basically means you are no longer on any branch. You probably checked out a specific commit. To fix this problem, all you have to do is checkout the branch you were previously on:
git checkout master
Tags: detached head, Git, software development