Local git repository only
To erase your whole history and start over again, run the commands below and start committing again:
cd <repo>
rm -rf .git
git init
If you want to remove both files and history, run the commands below and start committing again:
cd <repo>
rm -rf *
git init
Local repo with a remote repository
To start over again, but retain history there is a quick way:
git pull
git rm -r *
git commit
git push
To also clean up the history (N.B. this will cause trouble for anyone else linked to that same remote repository):
git checkout <first commit hash>
git rm -r *
touch README
git add README
git commit --amend
git push -f
Create an empty README file for the first commit, as a commit cannot be empty.
Refs: