1

I had performed some local changes to my repository and committed them to my local repo. While fetching code from repository my system power got lost. As a result, my git repo got corrupted. Now when I'm checking out to the commit ID (local) as shown in git reflog it shows

error: object file ./objects/XX/YYYYYYYYYYYY is empty.

fatal: loose object XXYYYYYYYYYYYY is corrupt.

When doing git status it shows that the files corresponding to object files are deleted. As a result I'm not able to do git hash-object -w OBJECT-PATH. Also since this was a local commit, I simply can't replace the .git folder from remote server to my local repo.

Is there any way using which I can restore my commit and avoid redoing it?

Community
  • 1
  • 1
rango
  • 311
  • 1
  • 13

0 Answers0