Accidently I got detached from my application branch:
Not currently on any branch.
nothing
to commit (working directory clean)
How can I return to the branch?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try:
… or whatever branch you were previously on. To give some further explanation:
One of the most common uses of
git checkoutis to switch from one branch to another. e.g.git checkout experiment,git checkout master. However, you can also give it the name of a tag, or the SHA1 sum (object name) of a commit – in those cases, git will change HEAD (which normally points to a branch, indicating that that’s your current branch) to point to that tag or commit. This is known as “detached HEAD” or “not being on a branch” – the main difference is that if you create commits when you’re in detached HEAD mode, they won’t advance a branch, so they’re easier to lose track of.However, this is a very useful thing to be able to do when you want to look at the state of your repository at some random point in the past. (e.g. jumping around in this way is often the first step of trying to find the last good commit for (the awesome)
git bisect.)