threads / discuss / 20694

How to recover from "reset --hard"

Subject: How to recover from "reset --hard"

## tl;dr

2 messages between Aug 22, 2009 and Aug 22, 2009.

replies: 1people: 1as markdown or json

Ping Yin· Aug 22, 2009, 02:53 UTC · lore

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· Aug 22, 2009, 06:06 UTC · re: Ping Yin · lore

Re: How to recover from "reset --hard"

On Sat, Aug 22, 2009 at 10:53 AM, Ping Yin<pkufranky@gmail.com> wrote:
Show 7 quoted lines
> 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.

← back to recent threads