0

Help! I wanted to show a friend how great git is and how much it will improve is his life.

I improved his life by deleting all his work.

So what I did in this main working directory was this:

git init

git stage -A

// at this point he said: Oh, I dont want to stage xyz, so I wanted to unstage everything and add to .gitignore

git reset --hard

At this point all files were removed. git reflog doesn't help as there has never been any commits.

Please tell me I (git!) didn't remove everything he ever worked on or else... :)

git --version 2.7.4

Wirsing
  • 6,713
  • 3
  • 15
  • 13
  • 2
    Are you certain that the hard reset actually removed the _files_? Or, did it just revert all work your friend has done since running `git init`? In any case, unfortunately a hard reset is for keepers; there is no way to undo it, unless you are using an IDE which maintains a local history for files. – Tim Biegeleisen Jun 01 '20 at 17:11
  • I cannot see them in bash anymore, so... – Wirsing Jun 01 '20 at 17:13
  • 4
    maybe [this](https://stackoverflow.com/q/7374069/5993410) would help – Atef Hares Jun 01 '20 at 17:14

0 Answers0