I obliterated all my work and would prefer not to explain how.
The only thing I have left are the git objects. More then anything I would like to recover some of the loss packed Image files. From the size of the object files I can tell which ones they are. Is there a way to turn them back into usable files?
I obliterated all my work and would prefer not to explain how. The only
Share
first thing: make a backup! then work on a copy of that backup.
if the git objects are still in the correct directory (
.git/objects/xx/xxx…) you can usegit fsck --fullfor git to discover them — it will probably list every object in your repository. now look for the ones labeledcommitandtag, those are the ones you want to recover.i would probably use a script which creates a branch for each commit object found (e.g. simply increnting numbers
rescue-1,rescue-2, etc.). afterwards usegitk --allto visualize all your branches and pick the top (most recent) one. create a new branch thererescued-master.checkout your new master branch and run
git branch --no-merge. you should get a list of branched off commits, not contained in master. you probably want to give them a new branch name too.after you’re done, delete all the numbered
rescue-branches.hope that helps and gives a a starting point.