# How to recover from "reset --hard"

2 messages from 2009-08-22 to 2009-08-22. Participants: Ping Yin.
Thread: https://gitlist.dev/t/20694

## Ping Yin, 2009-08-22 02:53

Subject: How to recover from "reset --hard"
Message-ID: <46dff0320908211953u2f63cdb4m9cab863266a03df7@mail.gmail.com>
URL: https://gitlist.dev/e/46dff0320908211953u2f63cdb4m9cab863266a03df7%40mail.gmail.com

```
After adding a file to index, i do a "reset --hard", then how do i
recovery the file?

I want write all lost files to a directory and find it according to
the file size.

Does "git fsck --lost-found" write this file to .git\lost-found\other ?

Ping Yin

```

## Ping Yin, 2009-08-22 06:06

Subject: Re: How to recover from "reset --hard"
Message-ID: <46dff0320908212306v6b4aec03g761e1ee9035462c4@mail.gmail.com>
URL: https://gitlist.dev/e/46dff0320908212306v6b4aec03g761e1ee9035462c4%40mail.gmail.com
In-Reply-To: <46dff0320908211953u2f63cdb4m9cab863266a03df7@mail.gmail.com>

```
On Sat, Aug 22, 2009 at 10:53 AM, Ping Yin<pkufranky@gmail.com> wrote:
> After adding a file to index, i do a "reset --hard", then how do i
> recovery the file?
>
> I want write all lost files to a directory and find it according to
> the file size.
>
> Does "git fsck --lost-found" write this file to .git\lost-found\other ?

It does. I just remembered the wrong size of the file. Sorry for the noise.

```
