Initialized empty Git repo in C:/git revert example We will start with a git init command to create a completely clean repository: /c/revert example/ SMARTGIT PUSH TO GERRIT HOW TOTo really understand how to undo Git commits, look at this git revert example. All developers need to do is issue the git revert command and provide the ID of the commit to undo: /c/revert example/ The syntax to revert a Git commit and undo unwanted changes is simple. A new commit is also created to reflect the new state of your repository. When you revert a Git commit, the changes from the targeted commit are removed from your local workspace. If a past commit added a new line of code to a Java file, a git revert on that commit will remove the added line. For example, if a past commit added a file named index.html to the repo, a git revert on that commit will remove the index.html file from the repo. The purpose of the git revert command is to remove all the changes a single commit made to your source code repository.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |