Git: Clear local and remote repo and start over

I accidentally got a repo in a bad state when trying to move a project from using ant to maven. Now, I would like to clear the repo and startover from scratch. Being new to git, I am a little cautious and not sure if I could just checkout then delete all files and folders locally then push to the remote repo or if that was actually a very bad idea. For some reason I'm having a hard time asking the correct questions in google. :D


Simply remove local .git directory, remove repo from server (if it is github - do Repo -> setiings -> remove).

Then create new repository on server, and locally do:

git init
git remote add origin [email protected]:user/project.git
git add .
git commit -m "Initial commit"
git push -u origin master

In my case I just wanted to refresh the local repo, I used Ruslan answer without the last two commands since I didn't need to do anything on the server side, and it worked perfectly! Of course I deleted the .git file locally as suggested without removing the remote directory before to execute the commands. Thanks!