git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Rast <trast@student.ethz.ch>
To: Daniel <mjucde@o2.pl>
Cc: <git@vger.kernel.org>
Subject: Re: Can I retrieve changes from deleted stash?
Date: Mon, 5 Oct 2009 14:30:13 +0200	[thread overview]
Message-ID: <200910051430.17559.trast@student.ethz.ch> (raw)
In-Reply-To: <c18a43e.55008170.4ac9e127.2a972@o2.pl>

[-- Attachment #1: Type: Text/Plain, Size: 901 bytes --]

Daniel wrote:
> I did:
> 
> $ git stash
> $ git pop
> 
> $ git checkout -- <modified files>
> 
> Now I don't have changes I stashed. I guess the blobs with stashed
> files should be somewhere?  Is there any way I can get back my changes?
> I tried to use git-reflog, but I'm not sure how can I find the files
> I need.

The problem is that the stash itself is a reflog, so there is no extra
safety layer.

Recent versions of the git-stash(1) manpage[*] document a command that
helps find the stashes: if you do not explicitly name them, the they
will be called "WIP on <subject>" and can thus be found with

  git fsck --unreachable |
  grep commit | cut -d\  -f3 |
  xargs git log --merges --no-walk --grep=WIP


[*] you can find a bleeding edge version at

  http://www.kernel.org/pub/software/scm/git/docs/git-stash.html

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2009-10-05 12:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-05 12:05 Can I retrieve changes from deleted stash? Daniel
2009-10-05 12:30 ` Thomas Rast [this message]
2009-10-05 12:50   ` mjucde

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=200910051430.17559.trast@student.ethz.ch \
    --to=trast@student.ethz.ch \
    --cc=git@vger.kernel.org \
    --cc=mjucde@o2.pl \
    /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).