![A stick figure smiling](/images/welcome.jpg)
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!
![Image of a comic. To read the full HTML alt text, click "read the transcript".](/images/uploads/12-ohshit-accidentally-wrong-branch-2-web.png)
read the transcript!
Make sure you have main checked out:
git checkout main
Create the new branch:
git branch my-new-branch
Remove the unwanted commit from main:
git status git reset --hard HEAD~
(careful!)
Check out the new branch!
git checkout my-new-branch
Smiling stick figure with medium length straight hair: git branch
and git checkout -b
both create a new branch. The difference is git checkout -b
also checks out the branch
Saturday Morning Comics!
Want another comic like this in your email every Saturday? Sign up here!