Skip to Content
Navigation:

A stick figure smiling

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".
read the transcript!
  1. Make sure you have main checked out:
    git checkout main

  2. Create the new branch:
    git branch my-new-branch

  3. Remove the unwanted commit from main:

git status
git reset --hard HEAD~

(careful!)

  1. 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