2

I ran the below command to fix the this issue:

find .git/objects/bd/4e31f16fc91fdc25b4b8e50c16c6f12422d467 -size 0 -exec rm -f {} \;

After that when I force pushed my code after rebasing & squashing older commit, everything is lost and pull request got closed automatically erasing all commits. There is no way I can get back my code from whatever I know. The commits have vanished.

Is there any way to get back my committed code?

JavaYouth
  • 1,536
  • 7
  • 21
  • 39

1 Answers1

1

pull request got closed automatically erasing all commits

If this pull request is done on GitHub, then GitHub support would still be able to restore those commits, erased by the forced push.

Through the GitHub API, you can even yourself query the past push events, performing a "poor man reflog".

But regarding local commits, check first your git reflog.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250