6/2/2023 0 Comments Undo git gc![]() If the old commit is “matter”, the new commit is “anti-matter”-anything removed in the old commit will be added in the new commit and anything added in the old commit will be removed in the new commit. What’s happening: git revert will create a new commit that’s the opposite (or inverse) of the given SHA. Scenario: You just ran git push, sending your changes to GitHub, now you realize there’s a problem with one of those commits. In this post, I’m going to take a look at some common scenarios where you might want to “undo” a change you’ve made and the best way to do it using Git. ![]() When you make a new commit, Git stores a snapshot of your repository at that specific moment in time later, you can use Git to go back to an earlier version of your project. In Git, “undo” can mean many slightly different things. One of the most useful features of any version control system is the ability to “undo” your mistakes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
June 2023
Categories |