How do I get rid of everything and start again, and push the correct folder contents?
If you just want to remove the current content of the repository and start all over again:
Simply delete the .git
folder and add any content you want
rm -rf .git
git init
git add .
git commit -m "message"
How to remove content already in the remote repo?
# remove any content from the repo
git rm --cached <any files you want to remove"
# update the removed files
git add . -A
# commit the file you have deleted
git commit -m "..."
# push changes
git push origin <branch>
NOTE:
The content will be in the repository and in the next commits it will be removed
How to remove content from the repository and all its history
You can user interactive rebase of git filter-branch
In order to edit and change the history (rebase
) follow those steps:
// X is the number of commits you wish to squash
git rebase -i HEAD~X
Once you squash your commits - choose the e
for edit, when the process stops remove the desired file and then continue and commit your changes.

Once you have completed the rebase
push the changes with git push -f
NOTE:
Rebase is a destructive and should only be done on branches which no one else has checkout or their work will be lost.
More Options:
How to change the content of the repo - reverting or undoing