What to do? Throw away my current changes? Checkout a clean branch? Of course not! Just stash my changes away, fix the bug, and get my changes back so I can continue development.
It's so simple and useful, I thought I'd share my notes in case others don't know about git-stash.
git-status # we have a bunch of uncommitted changes git-stash # stashes away changes, reverts working copy to HEAD git-status # no uncommitted changes ... fix the bug git-stash list # see what we have stashed away git-stash pop # apply uncommitted changes back to working copy
The above makes simple use of the Git stash, but there is lots more you can do with it. Also remember that the stash acts like a stack which means you can store multiple stashes.