Skip to content

How to recover accidentally deleted files in Android Studio


Introduction

When you using Android Studio to develop an App, you accidentally deleted an important file. Now, how can you save it?

Android Studio kindly provides am option called “Local History”, and you can recover your file with it.

And then, I will record the steps that you should be done below.


How to recover your file

First of all, we suppose there is the following folder in your project, which contains two files:

  • MainActivity
  • test

Now I delete the test file.

At this time if we go to the default trash can, the deleted file cannot be found.

But at this time, you can right-click on this folder and select “Local History” => “Show History”.

After opening, you will see the record of your historical operations on this folder.

Just looks like this.

you can recover the file by clicking the right button of the item you want to recover and selecting “Revert Selection“.


When JetBrains develops IDE, most of them will build this function in it, maybe many IDEs have it. So if you accidentally delete the files you developed, don’t worry and check to see if the IDE you are using has this feature!

Leave a Reply