Committing in Small Increments
Small commits are your safety net. Each one should be a single coherent step:
git commit -m "Add star button to item cards"
git commit -m "Toggle favorite state on star click"
git commit -m "Add favorites counter to list header"
git commit -m "Persist favorites in localStorage"
If step 4 goes sideways, your first three steps are safe and you lose almost nothing. Big, rare commits are how people end up afraid to touch their own code.