Git stash awesomeness

The problem: I stashed a bunch of code that I was working on so that I could get back to a clean slate to make sure that I wasn't making the problem worse.

The Next Issue: I want to check out the files from the stash (and not just a stash pop) one at a time so that I can test the changes that I've made in isolation.

The Solution: I didn't know this existed, but a wonderful Stack Overflow article helped me with being able to check out one file at a time from the stash so that I could find out where my problem is. This isn't a solution I use all the time, but it's nice to have when I need it.

git checkout stash@{0} -- <filename>

If you're not using the latest stash, then you need to use the correct reference for the stash instead of stash@{0}, but the concept is the same. You can check a specific file out of the stash by path and filename. A real timesaver for me when debugging some issues.

Share this post