Recovering files deleted by Android studio?

Viewed 19978

I'm working on an app at the moment, and one of the final steps was to get it built and signed in Android studio.

Unfortunately I was having some problems, and one of the recommended solutions was to remove the project and start again, however when I did this it took all of my files with it, and they're not in the trash (OSX) either.

Is there anyway to recover these files, or are they lost forever? :(

5 Answers

In my case I was looking for the file named 'landing_page222.java' which I deleted one day back.

Following Steps can help you to find your previously deleted files in Android Studio.

Step 1: Right Click on the folder where you deleted the file

enter image description here

Step 2: Find option for Local History and Click Show History.

enter image description here

Step 3: Find your File from Given List.

Hopefully it will be available in Instance enter image description here

Step 4: Copy the code back as per need.

enter image description here

Click whereever you want in the left frame (for example "drawable" file is ok) and then press CTRL+z. You are going to see "Undo delete popup" window.

And as you understand, when you press CTRL+z in Android Studio, which (XML or Java) file is active, you will undo the action on that tab. So, if you click any file on the left side and press the CTRL+z combination, you will undo the action at the file structure.

Go to View > Recent Changes > Click on the file you want to recover > Click "Revert"

Im late but this works. Go to the folder where u want to recover. right-click, local history. select ones you deleted and click revert. :)

Related