Copied shamelessly from StackOverflow
- Checkout to an orphan branch
git checkout --orphan temp_branch
- Add all files and commit
git add -A
git commit -am "commit message"
- Delete the branch
git branch -D master
- Rename current branch to master
git branch -m master
- Force push to remote
git push -f origin master