- Create the branch and switch to it
git switch -c fix-login-button - Share it on GitHub
git push -u origin fix-login-buttonOnly needed when you want others to see it. Run it after your first commit.
Check it worked
- List your branches
git branchThe one with a * is the branch you're on.
Undo it
- Go back to main
git switch main - Delete the branch
git branch -d fix-login-buttonGit refuses if the branch has work that isn't merged yet. Use -D to delete it anyway.
- Create the branch and switch to it
git switch -c fix-login-button - Share it on GitHub
git push -u origin fix-login-buttonOnly needed when you want others to see it. Run it after your first commit.
Check it worked
- List your branches
git branchThe one with a * is the branch you're on.
Undo it
- Go back to main
git switch main - Delete the branch
git branch -d fix-login-buttonGit refuses if the branch has work that isn't merged yet. Use -D to delete it anyway.
- Create the branch and switch to it
git switch -c fix-login-button - Share it on GitHub
git push -u origin fix-login-buttonOnly needed when you want others to see it. Run it after your first commit.
Check it worked
- List your branches
git branchThe one with a * is the branch you're on.
Undo it
- Go back to main
git switch main - Delete the branch
git branch -d fix-login-buttonGit refuses if the branch has work that isn't merged yet. Use -D to delete it anyway.

New to Branch? I explain it in plain English on Layman Terms.