Git Stash Failed

Jake Wilson picture Jake Wilson · Feb 17, 2015 · Viewed 7.4k times · Source

I am using SmartGit in Windows. Today I needed to do a hard reset back a couple commits. SmartGit automatically made a stash for me of my modified files.

After the reset, it tried to apply the stash:

$ git.exe stash apply --index stash@{0}

But it gave me:

Apply Stash: stash failed (return code 1).

I can view the stash contents and see all my code, but I can't apply the stash. How do I fix this?

Answer

Mudassir Razvi picture Mudassir Razvi · Feb 17, 2015

Just do git stash pop. It will get you your stashed changes in the working tree. (pop considering you want stash@{0}.

Hope it helps!