threads / discuss / 10452

Recover a stash

Subject: Recover a stash

## tl;dr

2 messages between Oct 24, 2007 and Oct 24, 2007.

replies: 1people: 2as markdown or json

Medve Emilian-EMMEDVE1· Oct 24, 2007, 17:26 UTC · lore
Hello,

Is there any way to recover a stash as a... stash? I accidently removed a stash I still need and I'd like to recover it as a stash. I can see the dangling commit objects in the database with git lost-found and I can have a branch/head point at them, but it's not understood as stash anymore.

Thank you, Emil.

Johannes Schindelin· Oct 24, 2007, 17:42 UTC · re: Medve Emilian-EMMEDVE1 · lore

Re: Recover a stash

Hi,
On Wed, 24 Oct 2007, Medve Emilian-EMMEDVE1 wrote:
Show 5 quoted lines
> Is there any way to recover a stash as a... stash? I accidently removed 
> a stash I still need and I'd like to recover it as a stash. I can see 
> the dangling commit objects in the database with git lost-found and I 
> can have a branch/head point at them, but it's not understood as stash 
> anymore.
You should be able to recover it with
	git update-ref refs/stash <commit>

Where the <commit> points to the merge commit of the stashed index and the stashed working directory.

Hth, Dscho

← back to recent threads