I'm trying to test something that requires me to remove all commits after 02/14/2022. I found the commit hash xyz of the last commit on 02/13/2022, and did a
git reset --hard xyz but got the error
fatal: failed to unpack tree object d41dc error: Submodule 'third_party/eigen' could not be updated. error: Submodule 'third_party/eigen' cannot checkout new HEAD. fatal: Could not reset index file to revision 'xyz'. I'm not sure what the d41dc here is. Also tried git checkout xyz and it gives the same error
Does anyone know how to fix this or have a better approach?
git fsckmay get more details on the damage, but in general most people mostly fix these by removing and re-cloning anyway, so that there's no reason to see what's actually damaged. The more important question is how the damage occurred in the first place: is your disk drive failing? Did you have a power failure while Git was updating its databases? Did you store the repository in a cloud-synced folder and have the cloud-syncing software damage it?