Concept

Detached HEAD

HEAD identifies a commit directly rather than a branch. Preserve new commits by creating a branch before leaving. Start with a clean lab.

Formal Syntax & Structure

git syntaxgit
git switch --detach REV

Working Example

Example Snippetgit
git switch --detach HEAD~1
Git Reference