Park unfinished work with git stash
Need to switch branches but you're mid-change? Stash it, switch, and bring it back later.
- Run
git stashto save your uncommitted changes and clean the working tree. - Switch branches and do the urgent thing.
- Come back and run
git stash popto restore your changes. git stash listshows everything you've parked.
Tip: New files aren't stashed unless you add -u.
Try it now: Edit a file in any repo, run
git stash, check git status, then git stash pop.Next crumbs
- 💻 Terminal & gitFix your last commit with --amendForgot a file or made a typo in the message? Fold the fix into the commit you just made.
- 💻 Terminal & gitSee your branches as a graphOne log command turns a wall of commit text into a readable branch map.
- 💻 Terminal & gitJump back with cd -Toggle between your last two directories, like Alt+Tab for folders.