Branches: trying things without fear
A branch is a parallel copy of your project where you can experiment. Your main work lives on a branch usually called main. When you want to try something — a new feature, a risky AI rewrite — you make a new branch, do the work there, and your main stays untouched and safe.
If the experiment works, you merge it back into main. If it doesn't, you throw the branch away and main never knew it happened.
This is exactly how you should treat big AI changes. "Build the entire payments flow" deserves its own branch. If the AI produces something good, merge it. If it produces a disaster, delete the branch and you've lost nothing.
# Create a new branch and switch to it
git checkout -b new-feature
# ...do your work, make commits...
# Switch back to your safe main branch
git checkout main
# Merge the good work from your branch into main
git merge new-feature