1

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?

1
  • This would typically indicate a damaged repository database. Running git fsck may 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? Commented May 14, 2022 at 3:05

1 Answer 1

1

Since your current local repository seems damaged, try first to re-clone in a different folder the remote repository locally.

Then apply your git reset in the new local repository.
If it works, consider renaming the existing (possible corrupted) one, and replacing it with the new (now reset) cloned repository.

Sign up to request clarification or add additional context in comments.

2 Comments

hmm I just cloned a fresh copy of the repo, and still have the issue. Maybe something is wrong with remote?
@David Indeed. If the issue persists with a new clone, then the remote repository does not have your reference.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.