Re: Objects deleted before first commit
- From
David Barr <davidbarr@google.com>
- Date
- Jun 14, 2011, 12:57 UTC
- Message-ID
- <BANLkTikSPNVbGFRUVh5eSFsxabVWT7SVVA@mail.gmail.com>
- In-Reply-To
- <8269100C7056D24A91B672AF7E5E48492D959E@exchange.GottexBrokers.local>
On Tue, Jun 14, 2011 at 10:43 PM, Edmondo Porcu <Edmondo.Porcu@gottexbrokers.com> wrote:
> I have created a git repository, and then I have deleted by error some files with rm -rf . > Now the files have disappeared from the hard disk, I am desperately looking on how to restore them. The objects folder is full of dangling objects, but I do not know how to recover them.
If you did use 'git add' to stage your work before the unfortunate invocation of rm, the blobs should be accessible.
Something like the following might work: git show `cd .git/objects; ls ??/* | tr -d /`
This will pretty print all loose objects. -- David Barr.