Here's a preview from my zine, Oh Shit! Git!! If you want to see more comics like this, sign up for my saturday comics newsletter or browse more comics!
read the transcript!
If you made a mistake but want to keep all of the commits since then, git revert
is your friend!
git revert
will create a reverse patch for the changes in a commit and add it as a new commit.
Find the commit SHA for the commit you want to undo.
Run:
git revert SHA
Enter a commit message for the revert commit.
Now all of the changes you made in that commit are undone!
person: this is super useful if you push a bad commit to a shared repository and need to undo it!
Saturday Morning Comics!
Want another comic like this in your email every Saturday? Sign up here!