I randomly hit this today while trying to run Git garbage collect:
$ git gc
fatal: bad object refs/remotes/origin/HEAD
error: failed to run repack
The cause of this for me was working in a compressed folder in Windows. When the folder was uncompressed, it corrupted the pack files, cascading other odd issues, such as not being able to prune nonexistent branches.
The only fix was to wipe out the working directory and clone the repo remote(s) again. Luckily, I could still push and pull updates to ensure nothing was lost. All is well now.