git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Luc Herren <jlh@gmx.ch>
To: "\"Iván V.\"" <elterrible@ivanyvenian.com>
Cc: git@vger.kernel.org
Subject: Re: Newbie question: Is it possible to undo a stash?
Date: Wed, 14 May 2008 22:51:40 +0200	[thread overview]
Message-ID: <482B50DC.3020400@gmx.ch> (raw)
In-Reply-To: <509f40850805141256gce6ac1brf5ced6436f81dae8@mail.gmail.com>

Hello!

Iván V. wrote:
> I just did a git stash, and then changed my mind and ran git apply,
> thinking that would get me back to where I was...

Certainly you mean "git stash apply".  "git apply" is something
different.

> Now I have lots of conflicting merges and files that came back from
> the dead (and some files seem lost)... I've been trying to go step by
> step to try to get the tree to where it was, but it's very
> complicated, so I was wondering if there is anything I can do to get
> my working tree exactly to where it was before I ran git stash...

git stash pop --index

I think that should get you exactly where you were before "git
stash".  The --index makes it also restore the index, which
wouldn't happen by default.  Using 'pop' instead of 'apply' makes
it remove the stash after re-applying it.

jlh

      parent reply	other threads:[~2008-05-14 20:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-14 19:56 Newbie question: Is it possible to undo a stash? Iván V.
2008-05-14 20:42 ` Jakub Narebski
2008-05-14 20:51 ` Jean-Luc Herren [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=482B50DC.3020400@gmx.ch \
    --to=jlh@gmx.ch \
    --cc=elterrible@ivanyvenian.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).