Git development
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Steven Grimm <koreth@midwinter.com>
Cc: git@vger.kernel.org
Subject: Re: Recovering from an aborted git-rebase?
Date: Tue, 9 Jan 2007 18:29:49 -0500	[thread overview]
Message-ID: <20070109232949.GB30023@spearce.org> (raw)
In-Reply-To: <45A42341.8040304@midwinter.com>

Steven Grimm <koreth@midwinter.com> wrote:
> Got this from one of the other people here who's using git. Luckily he 
> was able to restore his repo from a filesystem snapshot, so no permanent 
> harm done, but what's the pure-git way to recover from this? Are the 
> revisions in question really gone?

Try `git lost-found` before you use `git prune` (or also now `git gc`).

Also, if you have relogs enabled on your work branches (and I hope
you do, as its now the default) you can look at the branch from
earlier, e.g.:

	git log HEAD@{5.minutes.ago}
or
	git log HEAD@{1}

to look at HEAD was just before `git rebase` did the reset.  Which
would be the commit you lost, but want back.


Unfortunately we don't really have a reflog viewing utility yet so
you just have to sort of guess around with the @{...} syntax to find
what you are looking for.  But if you can locate the correct SHA1
for the last commit you want back you can do a `git reset --hard $sha1`
to restore your working branch, then do the rebase the way you meant to.
 
-- 
Shawn.

  reply	other threads:[~2007-01-09 23:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-09 23:20 Recovering from an aborted git-rebase? Steven Grimm
2007-01-09 23:29 ` Shawn O. Pearce [this message]
2007-01-10  0:25 ` Junio C Hamano
2007-01-10 18:53   ` Steven Grimm

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=20070109232949.GB30023@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=koreth@midwinter.com \
    /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