How do I fix a Git detached head? – Stack Overflow

3 When you’re in a detached head situation and created new files, first make sure that these new files are added to the index, for example with: git add . But if you’ve only changed or deleted existing files, you can add (-a) and commit with a message (-m) at the the same time via: git commit -a -m “my adjustment message”

Read More