{"thread":{"id":"42984","subject":"Recovering Folder from Git Restored Repo","startedAt":"2016-08-01T21:14:48Z","lastAt":"2016-08-01T21:18:32Z","messageCount":2,"participants":["Dennis Putnam","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"292794","messageId":"84080bca-af5f-b957-460a-0a4a81f383e7@bellsouth.net","threadId":"42984","inReplyTo":null,"subject":"Recovering Folder from Git Restored Repo","fromName":"Dennis Putnam","fromEmail":"dap1@bellsouth.net","sentAt":"2016-08-01T20:58:47Z","receivedAt":"2016-08-01T21:14:48Z","isPatch":false,"sender":{"key":"dap1@bellsouth.net","avatar":null},"body":"I am in a bit of a pickle. I deleted a remote repo that had a folder\nthat I belatedly realized I need. The deleted repo exists on a backup\nwhich I restored. How do I extract the needed folder from that restored\nrepo. Not being a git expert I'm not sure what to do but I cannot find\nany recognizable sources. This is an 'ls' of the restored repo:\n\nbranches  config  description  HEAD  hooks  info  objects  ref\n\nTIA.\n\n\n"},{"id":"292796","messageId":"20160801211824.cmjhpvdlohla7cbk@sigill.intra.peff.net","threadId":"42984","inReplyTo":"84080bca-af5f-b957-460a-0a4a81f383e7@bellsouth.net","subject":"Re: Recovering Folder from Git Restored Repo","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-08-01T21:18:25Z","receivedAt":"2016-08-01T21:18:32Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Aug 01, 2016 at 04:58:47PM -0400, Dennis Putnam wrote:\n\n> I am in a bit of a pickle. I deleted a remote repo that had a folder\n> that I belatedly realized I need. The deleted repo exists on a backup\n> which I restored. How do I extract the needed folder from that restored\n> repo. Not being a git expert I'm not sure what to do but I cannot find\n> any recognizable sources. This is an 'ls' of the restored repo:\n> \n> branches  config  description  HEAD  hooks  info  objects  ref\n\nThat's a \"bare\" repository, which has no matching working tree, just the\ngit data. The simplest thing may be to just clone it; the clone will\nhave a working tree:\n\n  git clone /path/to/restored-repo tmp\n  cd tmp\n\nand then you can pick out whatever files you like.\n\nYou can also extract the data straight from the bare repository.  Try\n\"git ls-tree -r HEAD\" to see the complete listing of files (replace HEAD\nwith the name of a specific branch if it was there). You can extract\nindividual files with \"git show HEAD:path/to/file\". Or you can generate\na tar or zip archive of a subtree like:\n\n  git archive --format=zip HEAD:my-subdir >foo.zip\n\n-Peff\n"}]}