You can (with some work) recover state of file at the last “git add <file>“. You can use
$ git fsck --cache --no-reflogs --lost-found --dangling HEAD
and then examine files in ‘.git/lost-found/other’ directory.
Please read git fsck manpage.
More Related Contents:
- Ignore files that have already been committed to a Git repository [duplicate]
- Git for beginners: The definitive practical guide
- How to list branches that contain a given commit?
- Which commit has this blob?
- How can I delete all Git branches which have been merged?
- Git: “Corrupt loose object”
- git-upload-pack: command not found, when cloning remote Git repo
- Warning: push.default is unset; its implicit value is changing in Git 2.0
- Rebasing a branch including all its children
- Git Init in home directory – now unable to commit changes
- What’s the best visual merge tool for Git? [closed]
- Preferred Github workflow for updating a pull request after code review
- git add * (asterisk) vs git add . (period)
- git gc –aggressive vs git repack
- git push to multiple repositories simultaneously [duplicate]
- How do I change the author and committer name/email for multiple commits?
- Git interoperability with a Mercurial Repository
- How do I make a Git commit in the past?
- How to get back to the latest commit after checking out a previous commit?
- How to perform better document version control on Excel files and SQL schema files
- Locking binary files using git version control system
- Can I make a user-specific gitignore file?
- Git mergetool generates unwanted .orig files
- git commit frequency
- Git branch name – case sensitive or insensitive?
- Git: How to reset a remote Git repository to remove all commits?
- How do I check out a specific version of a submodule using ‘git submodule’?
- How do I remove a single file from the staging area (undo git add)?
- How to convert a Git repo to a submodule, which is nested in another (parent) Git repo?
- Limiting file size in git repository