I tried reverting to a previous git commit with:
git revert xxx
I\'m now receiving this error as a response:
fatal: bad object
This issue can arise when there's an outdated or corrupted branch stored locally.
Deleting the file .git/refs/remotes/origin/xxx (after making a backup!) then fetching a fresh copy from the server worked for me.
.git/refs/remotes/origin/xxx
More detail at GitHub.