Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8368587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:25:32+00:00 2026-06-09T13:25:32+00:00

I had this git message after a forced VM shutdown, which obviously corrupted the

  • 0

I had this git message after a forced VM shutdown, which obviously corrupted the git index

Git: Failed to read object abcdef.... Invalid argument

I looked at these existing answers

Restore a corrupted index
Recover damaged git by HD failure

None seemed to work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:25:32+00:00Added an answer on June 9, 2026 at 1:25 pm

    Lets get into it and try to solve it. Use this approach only when git reflog also won’t work, because obviously your index is corrupted, and reflog cannot read from a broken index.

    Open your .git/ folder

    Look at the file called HEAD.
    This has the name of the branch your git is currently at.

    Now look for a file called ORIG_HEAD.
    This probably has the SHA of the last good commit that git was able to register. If it is, Voila!

    Copy it (say X), in terminal do:
    git show X > interim.patch

    This copies your last successful changes into a standard diff.

    Also copy this SHA (X) to HEAD file’s contents.
    This tells git to consider this change as the current position, which it could live with, as it had registered it some time back.

    By now if you do a git branch, you would have moved to (no branch).

    So now you have your changes. Do git checkout -f <branch-name>
    This will overwrite your changes with the remote contents, but you still have them in that patch.

    So by now, you are

    • onto a git branch
    • git is restored

    Do a git apply interim.patch which if goes through well, means you have your changes.
    Then go ahead with normal git steps.

    • git add .
    • git commit -am 'Message'

    And you are back to normal peaceful life.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had this, which was working fine: public static Integer[] photos = new Integer[]
I had this nasty bug that disappeared in the past but now after quite
Coming from an svn background, I had this question: git equivalent of svn status
I read a similar question about this that suggested using git log --graph --all
Had this working; at one stage. The problem is the following text is now
I had this weird problem a little while ago and haven't been able to
I had this working at some point, as I had a question about this
I had this jquery idle timeout script implemented into a site, thanks to ehynds
I had this problem before and can't for life of me remember how to
I had this doubt for sometime now, some people say that there's no such

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.