Recovering from a "detached from" HEAD

From: Alyssa Ross <hidden>
Date: 2019-01-07 16:17:55

If I detach my head, then use `git subtree add` to generate a commit,
the output from `git status` changes from "detached at SHA" to
"detached from SHA". The sha doesn't change, but HEAD has updated.

I don't understand why `git status` doesn't tell me that I'm
"detached at" the sha of the new commit, but not only that, it seems to
be extremely difficult to get `git status` to reflect my actual HEAD.
`git checkout HEAD` doesn't change it, `git checkout NEWSHA` doesn't
work.

So my question is, what's going on here? Is this intentional behaviour,
or a bug? How should I get my working tree back to a normal state?

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help