Darren Findlay Darren Findlay - 1 month ago 18
Git Question

"Git stash apply" all files, except one

I made a stash of multiple files (30 +) using git stash. I now want to apply the stash to all files except one. What is the best way to achieve this?

Answer

Your best bet is to probably to git stash apply then git checkout -- [file] to remove the changes applied when applying the stash.

If you have changes in the file already, your best bet is to commit them before applying the stash, you could then rebase the commit and the stash into a single commit later if you wished.

Comments