Chris
Chris

Reputation: 57

Lost File's Contents in Git: How Can I Recover Them?

A few months ago I finished up a project and pushed to git (using Github). Then I came back to the code a couple weeks ago and noticed the files I pushed with my last commit were empty, they were all there, but empty.

Since this was the very last commit, I don't have any history except that last commit. I've searched through git log, reflog, and stashes to find the contents but found none of the file's contents. I'm very confused how this would've happened, I wouldn't have pushed empty files. I never deleted the code locally, but I did pull once since then since I made Readme changes on another computer (before I noticed the missing file contents). Is there anything else I should try?

I should've pushed more and made backups, but here we are. Now daily file history is being saved to another disk.

Upvotes: 0

Views: 58

Answers (0)

Related Questions