Skip to content

Try our new Crash Courses!

Buy one of our new Crash Courses, now hosted on Teachable.

Undo git init – Git

Details

When you use the git init command, it creates a folder called .git inside of your project folder. To undo the git init command, you can simply delete the .git folder. However, since it starts with a period, it is considered a hidden folder and will likely not show up in Finder on macOS or File Explorer on Windows 10. Here’s how to show hidden files and folders on each operating system.

Show hidden files and folders on macOS

To show hidden files and folders on macOS, use the Cmd+Shift+. shortcut inside Finder. You can use the same shortcut to hide the files and folders again.

Show hidden files and folders on Windows 10

In the search box on the taskbar, type folder, then click File Explorer Options in the results. In the dialog box that appears, click on the View tab. In the list of options that appear, select Show hidden files, folders, and drives and click OK.

After you’ve turned on the setting to show hidden files and folders on your operating system, you should now be able to see the .git folder inside your project folder. You can now move it to the Trash or Recycle Bin.

This process can be useful if you use the git init command inside the wrong folder, or if you simply need to start the setup process over.

Exercises

There are no exercises for this lesson.

References

Show hidden files from Windows support

Back to: Git Reference > Git Undoing Things