git stash provides a stack, which you can access via
to pop. However, git stash is more versatile than just that.
will display the full stack, and you can pop off any given stashed diff with
or apply without removing via
which will similarly default to applying the top of the stack.
git stash also provides a neat flag, --keep-index, which lets you stash with pretty good granularity. If there are some things that you want to stash, and some you don't, use
which lets you interactively decide what changes you want to stash, and which you want to keep.
So, now that you can add parts of your changeset to your stash, you have a useful toolset for comparing different patches, and adding them in any which order. In my case, I have some logging code that I want to be able to use locally, but I don't want to push to production, so when I want to log, I
to use it, and just keep it at the bottom element in my stack. Sometimes I have a few things I want to play around with for a single feature, but it doesn't seem important enough to merit its own branch, so I can just make two patches on the same patch, and play around with applying them first each on their own, and then together.
edit: I was spreading lies about --keep-index, so I removed that information.