2010-06-30 07:20:56

by Lin Ming

[permalink] [raw]
Subject: How to find a lost git commit?

Hi list,

I wrote some patch and checked it in my local branch.
But by accident, I run "git reset --hard" to reset the git head to
some other commit.

So now I can't find my patch because I don't know it's commit number.

Any idea?

Thanks,
Lin Ming


2010-06-30 07:34:06

by Lin Ming

[permalink] [raw]
Subject: Re: How to find a lost git commit?

On Wed, Jun 30, 2010 at 3:31 PM, Po-Yu Chuang <[email protected]> wrote:
> Hi Lin,
>
> 2010/6/30 Lin Ming <[email protected]>:
>> I wrote some patch and checked it in my local branch.
>> But by accident, I run "git reset --hard" to reset the git head to
>> some other commit.
>>
>> So now I can't find my patch because I don't know it's commit number.
> I guess git reflog is what you need.

Wow! That's it!

Many thanks.