Undelete a branch
Imagine you accidentally deleted a branch:
❯ git branch -D foo-branch
Deleted branch foo-branch (was d885d38).
Oh my god! What have I done?
Relax, you can easily create the branch again.
❯ git switch --detach d885d38
❯ git switch -c foo-branch