Is it still possible to restore deleted untracked files in git?

Said Kaldybaev picture Said Kaldybaev · Mar 17, 2012 · Viewed 34.3k times · Source

let's say yesterday I did some changes on my master branch, and I forgot to add, commit them. and in the morning i did

git reset --hard

is it possible to restore deleted files in this situation ?

Answer

Jovan Perovic picture Jovan Perovic · Mar 17, 2012

Some better IDEs keep track of your files as a local history. If you removed files externally (say, git reset) you should be able to click in your IDE on parent directory and choose "Compare with local history".

I used this feature successfully in PHPStorm IDE when my untracked files got wiped out by some utility...