Detached Head
Recovering a detached head created from a hard reset đź”—
“Accidentally” did a hard reset and lost commits I’d done.
git reflog
This showed the commit with a HEAD@{1}
next to it
git checkout HEAD@{1}
This moved me onto a detached head. And git gave me instructions how how to “save it”
git switch -c new_branch
This created a branch for my head and I just switched back to my previous branch and merged in the new_branch
. (Did in vscode don’t have command and they shouldn’t be hard to find).