The “git init” command is most usually the first command that a user runs on when starting a new project. This command allows the user to create a new Git repository. The command can be used to convert an old project into a Git Repository or to create a fresh repository. In this step, we will teach you the method to undo this command and reverse the changes made by this command.
How to Undo the “init” Command on Git?
In order to undo the effects of the “init” commands on the computer, we will be executing a command to delete the newly created git repository. Make sure that you execute the command accurately by following the indicated method. The Method differs slightly for Windows and Linux.
Method 1: For Linux
In this step, we will be undoing the changes made by the “init” command by deleting the git repository. For that, we will be executing a command in the terminal. In order to do that:
Method 2: For Windows
The method to undo the changes made by the init command for Windows differs slightly from the Linux one. Windows has a different command that can be executed in the command prompt to undo the changes. Therefore, in this step, we will be running the command prompt as administrator and executing the command. For that:
Fix: ‘git’ is not recognized as an internal or external commandHow to Undo and Redo with Ctrl + Z and Ctrl + YHow to Enable “Undo Send” in Gmail?Google Removes Undo Closed Tab Option From Chrome’s Tab Context Menu, Here’s How…