Daily Software Tips & Tricks
Bite-sized knowledge to improve your coding skills daily.
Git Stash - The Surgical Approach
April 11, 2026
Ever find yourself with a messy working directory where you only want to save half of your changes before switching branches? Instead of a blanket git stash, try using git stash -p (or --patch). This opens an interactive prompt that lets you review each hunk of code and decide exactly what goes into the stash and what stays behind.
It’s a lifesaver for keeping your experimental tweaks separate from your actual progress. It forces you to be intentional about your commits, which is a great habit for keeping your version history clean and readable for the rest of the team.