Nick
Nick

Reputation: 3965

Recovering files deleted by Android studio?

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? :(

Upvotes: 24

Views: 30125

Answers (5)

Rahul Shyokand
Rahul Shyokand

Reputation: 1505

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

Upvotes: 71

Nitin Tej
Nitin Tej

Reputation: 503

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. :)

Upvotes: 2

Michal
Michal

Reputation: 464

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

Upvotes: 10

Mustafa Karcıoğlu
Mustafa Karcıoğlu

Reputation: 406

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.

Upvotes: 12

user1301428
user1301428

Reputation: 1783

You can try:

  • looking for those files in the file system (perhaps they are still in your Android Studio projects folder)
  • looking in your OS's temp folder
  • using Android Studio's history feature (right-click on the Project tab > Local History > Show history)

Upvotes: 36

Related Questions