I created a project in Android Studio (Version 1.2) and after working on that project for a few weeks, my PC suddenly shut down (Android Studio was open at that time).
Can you find the file in file explorer?
If you can, try to open the file through another explorer
You can find your projects path by right clicking the project and hitting "File Path"
Is there local history available?
Try right clicking the faulty file and checking Local History -> Show History
If you can fetch the local history, right click the history entry and click revert
you can go to VCS>Local History>show History and find from which Hour/minute you want to revert and hit revert. I've done this before and it saved my life.
If the file is not exists anymore, create a new file with the exact same name then try to use VCS-> Local History-> show History.
This was the only way works for me for a new file that was saved correctly/deleted.
This is yet another day, Android studio saved my days of hardwork when I accidentally deleted an entire project files (note: the root folder of the project was available). There were no files left to search for local history. Steps I followed as below.
Opened the root project in Android studio.
And right click on the parent folder, from which is empty currently -> choose 'Local history' -> 'show history'.
This will show all the deleted files as 'External change' , now you can revert back to the entry before the history item marked as 'External change'. This will revert back all the 'Shift + deleted' files!
After recovery I can still see some files which are missing recent changes, which can obviously be recovered using the same process for individual files.
Now I was able to recover an entire android studio project which was 'shift+deleted'. This is a priceless moment for me :)