Consider the following workflow: I created new (untracked) tests for a class after making changes to it which made the tests necessary and then realized that I need to change the logic of another set of tests which I thought would be a different commit, so I ran git stash save -u
. Then, I realized that I need the stashed tests. How to get them as easy as possible?
My approach would be git stash branch
and checkout the untracked test files (as described in How to get just one file from another branch), but that only works if no conflicts occur if the stash is applied (warning: git stash branch
pops the stash anyway and messes up your working directory although failing with a verbose error message would be the way to go here).
I only want the untracked file(s) from the stash, but not the rest of it.
I'm using git 2.14.1 on Ubuntu 17.10.