Only applicable when object is empty...
- Backup
$> cp -a .git .git-old
$> git fsck --full
- Remove empty files by using "rm", continue until none is left and the "missing blob" starts showing
$> find .git/objects/ -size 0 -delete
$> git reflog
- It will show "fatal: bad object HEAD"
$> tail -n 2 .git/logs/refs/heads/<branch-i-was-working-on>
- Identify parent of last commit (the one HEAD is pointing to), easily recognizable as it will show up twice
$> git show commit_parent
$> git update-ref HEAD commit_parent
$> git fsck --full
- There are some blobs left from outdated index, nuke and carry on
$> rm .git/index
$> git reset
- There should be only references to "dangling blobs", these are not errors, continue
$> git status
$> git add .
$> git commit -m "Recovering from lost objects"