I accidentally removed the entire directory of my source code...with a nice rm -r. I know, really bad; but fortunately, I had a git repo in the containing directory. Thus, g
Something similar has happened to me. I have used the Android Studio, but it would work in other JetBrains IDE's as well.
I have restored my deleted files via Local history > show history and then I have reverted all deleted files.
Local history > show history
Hope it helps someone.