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:
rd /s /q .git
Yeah, that’s all.