2

Problem

Yesterday I had a local git repository that contained a .py and a .csv file. The changes that I made to them were not committed since earlier this week but they were all saved locally on my computer.

Last night I had an automatic windows 10 update and shut my computer down. When I opened it up this morning, the repository was reverted to a previous state (before what is currently on Master) without my doing anything. My files are now gone.

What I've Tried

  1. I contacted Microsoft support (I'm using Windows 10) and they said that it wasn't caused by the update and that the files cannot be found anywhere on my computer/there's nothing they can do.

  2. I also used a data recovery program (EaseUS) but none of the files show up

  3. I have also looked at some similar questions on here but have gotten nothing:

    a. unstaged files gone after git reset --hard

    • using: git fsck --full --unreachable --no-reflog, and git cat-file -p SHA don't return any of my file names

    • Looking at the recently opened section of my IDE does not show anything. The file paths still show up on the recently opened section of excel however (for csv file) but it cannot open it because it doesn't exist anymore

Are there any commands I can run to get my old files back? Or even see if they still exist?

EDIT

I understand that my files are most likely gone but why would this happen? I never used any commands to do this. Even if the files cannot be recovered, why or how could this happen without my doing anything other than shutting down my computer?

Community
  • 1
  • 1
Sean
  • 117
  • 2
  • 7
  • I don't believe that this question is a duplicate of the other and should not have been marked as such. While the results are similar, the situation is completely different. The other person deliberately used commands which lead to his problem. All I did was shut down my computer so this problem was not caused by me as far as I know. I am looking for a solution or explanation to my problem/situation specifically. – Sean Dec 08 '19 at 22:46
  • Looking for a solution -> duplicate. Looking for an explanation -> off-topic/too broad. I mean we can speculate, but that's not really useful. It might be an interesting topic to explore on a coding forum, but it's not a good question for SO. Either way, the question should remain closed. – Max Vollmer Dec 09 '19 at 02:04

1 Answers1

1

Git itself would not revert/erase anything without an explicit command.

Check in your repository path\.git\hook if you see any hook active (without .sample at the end) which might have been called, but I doubt it.

Depending on the IDE/editor you were using, you might get back some on your files using the local history feature that some of them could have.

Check to be sure the git reflog, for any recent commit (even if you did not yourself commit those changes)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250