how to get out of detached head git code example Example: git return from detached head git checkout <branchname>