From: Pierre Habouzit Date: Wed, 11 Jun 2008 07:46:49 GMT Subject: Re: Help rescuing a repository Message-ID: <20080611074649.GC28629@artemis.madism.org> In-Reply-To: <025E3DB6-D0A8-497E-A5EF-9B4011FA3272@vicaya.com> On Wed, Jun 11, 2008 at 05:04:25AM +0000, Luke Lu wrote: > git rebase --abort, I think, would actually blow away my last commit (I > sneaked in) though. git reset --hard to that last commit is probably the > right thing to do. The least confusing option would be to update the > error message to be a bit more informative, like "Did you change the > branch while rebasing? git reset --hard to your last known commit and > redo the rebase". Yet another safeguard would be for git commit to check > if there is a rebase in progress and warn or abort the commit. OTOH the commit you did has been your HEAD for a moment, so it's easily cherry-pickable from your reflog. So I'd go for the git rebase --abort route, redo the rebase, and once done, then run git reflog and find the commit that you want to get back, and cherry-pick it with its proper reflog name: git cherry-pick HEAD@{nnn}. -- ·O· Pierre Habouzit ··O madcoder@debian.org OOO http://www.madism.org