how to reattach a detached head in git code example Example: git return from detached head git checkout <branchname>