How to Undo git init

As a developer who uses git version control system to travel back in time to before I bugged my code, I have on a few occasions run git init while standing in the wrong folder. I’ve had to do some research to find the solution and here is what worked for me.

For Mac users, you simply open the terminal or the command prompt and navigate to the folder you want to remove git from. Then run this command:

rm -rf .git

For Windows users, you have to run the following command after navigating to the right folder using the command prompt:

Yeah, that’s all.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store