Complete the phrase from `git status` output indicating detached HEAD state.
HEAD detached at [1]The phrase 'HEAD detached at commit' indicates that HEAD points directly to a commit, not a branch.
Complete the command to create a new branch from the current detached HEAD state.
git checkout -b [1]To save work from a detached HEAD, create a new branch with a name like 'new-branch'.
Fix the error in the command to return to the main branch from a detached HEAD state.
git checkout [1]To leave detached HEAD and return to the main branch, checkout 'main'.
Fill both blanks to create a new branch and switch to it from a detached HEAD.
git [1] -b [2]
'git checkout -b new-branch' creates and switches to a new branch from detached HEAD.
Fill all three blanks to discard changes and return to the main branch from detached HEAD.
git [1] --hard [2] && git [3] main
This sequence resets changes to HEAD and then checks out the main branch.