Can I restore deleted files (undo a `git clean -fdx`)?

I was following the instructions on making github pages, and forgot to move down into my git sub directory. As a result, I just nuked an entire directory of documents with git clean -fdx.
Is there any way I can undo this terrible mistake?


Solution 1:

No. Those files are gone.

(Just checked on Linux: git clean calls unlink(), and does not backup up anything beforehand.)

Solution 2:

git clean -fdxn

Will do a dry run, and show you what files would be deleted if you ran

git clean -fdx

(of course this is only helpful if you know this ahead of time, but for next time)

Solution 3:

IntelliJ/Android Studio allows restoring files from local history.