alicht
alicht

Reputation: 819

Undoing a git commit on a folder that contains many other folders

I have a main folder called code which has many other folders, each one an individual project. I created a new folder called project2 but forgot to cd project2 before I hit git init... and am now accidentally tracking the entire code folder. Now, my the entire code folder is being tracked and shows (master) code! :/

How can I remove this entire commit without it impacting the rest of my files inside the code folder?

Upvotes: 0

Views: 20

Answers (1)

Beat
Beat

Reputation: 1380

All the git data is stored in a .git folder in your code directory. If you remove this folder, the newly created git repository is gone and you can create a new git repository in the subfolder project2.

Upvotes: 1

Related Questions