If I work on branch A and suddenly need to work on branch B before being ready with a commit on branch A, I stash my changes on A, checkout B, do my work there, then checkou
If you hit git stash when you have changes in the working copy (not in the staging area), git will create a stashed object and pushes onto the stack of stashes (just like you did git checkout -- . but you won't lose changes). Later, you can pop from the top of the stack.