tags:

views:

160

answers:

2

I really hope someone can advise.

I have 2 branches master | design

Working in design I did a stash and switched to master made some adjustments. Switched back to design and done a stash apply only to loose all my changes in the design branch.

I am hoping all my work is within a stash as I have not cleared or removed these.

If I do a stash list I get 4 results:

stash@{0}: WIP on design: f2c0c72... Adjust Password Recover Email
stash@{1}: WIP on design: f2c0c72... Adjust Password Recover Email
stash@{2}: WIP on design: eb65635... Email Adjust
stash@{3}: WIP on design: eb65635... Email Adjust

If I try git stash apply f2c0c72 Im getting error:

fatal: Needed a single revision
f2c0c72: no valid stashed state found

How can I apply a specific stash?

Hope someone can help !!

+3  A: 

The keys into the stash are actually the "stash@{n}" items on the left. So try "git stash apply stash@{0}" etc.

In fact stash@{0} is a revision in git that you can switch to... but "git stash apply..." should figure out how to DTRT to apply it to your current location.

araqnid
Fantastic I found my lost files.Thank you ever so much !!!
Lee
+5  A: 

To apply a stash and remove it from the stash list, run:

git stash pop stash@{n}

To apply a stash and keep it in the stash cache, run:

git stash apply stash@{n}
Dan Loewenherz