Blog Infos
Author
Published
Topics
,
Published

You probably should have taken a break hours ago, but you are just so close! Then all of a sudden, you realize that a core section of your project is gone, and you cannot for the life of you remember how you did it. However, today we are going to focus more on the solutions to recover deleted files in Android Studio rather than pour salt on the wound. If you’re experiencing an accidental deletion in Android Studio or in any other IDE, keep reading.

How to Restore Deleted Files/Projects in Android Studio

When it comes to programming, accidents or data loss can happen all too often. Don’t worry, even if you can not find anything in the default trash can. Just follow the steps below, and restoring deleted files in Android Studio can become much easier.

Restore Deleted Files in Android Studio

Unlike version control systems that only track changes between commits, local history records your project’s revisions as you edit code, run tests, deploy applications, and so on. You can actually solve most of your issues from local history, which lets you restore deleted files, bring back separate changes, or roll back to any state of a file. If you messed up some features and need to get back to the previous version of the project, it is also the easiest way for you.

  • Step 1. Switch the view to Android in the left part of the Android Studio, and right-click the class file (app node).
  • Step 2. Move to Local History. Local History should be near the bottom of the list of options and shows the most recent changes that you have made to your programs. Click Show History.

You can select any folder in the browser and check the Local History (i.e. the app directory).

  • Step 3. Find the version you desire there, right-click it and choose Revert selection.

Now, your whole project in Android Studio will be restored to the state you desire. Do not remember where the deleted file was housed? No need to worry! We have some more viable options for recovering those files. The key to this resides in the recent changes section. This method effectively helps you undo a deleted file in Android Studio.

  • Step 1. Follow this Path: View > Recent Changes
  • Step 2. Select the Deleted File. Click Revert. And just like that, your file is back!

Note: If you can’t find anything you desire in Local History and you local hard drives. In this situation, the only solution for you to restore the lost files in Android Studio is using the third party data recovery software.

Thank you for taking the time to read this article. If you found this post to be useful and interesting, please clap and recommend it.

If I got something wrong, mention it in the comments. I would love to improve

Connect with me on GitHub and LinkedIn.

This article was previously published on proandroiddev.com

OUR VIDEO RECOMMENDATION

,

Reap the benefits of Android Studio

Most of Android engineers use Android studio as their IDE and every new version of AS release we get many efficient features that we miss to use which can help to code and debug efficiently.
Watch Video

Reap the benefits of Android Studio

Sweety Bertilla
Principal Engineer
Comcast

Reap the benefits of Android Studio

Sweety Bertilla
Principal Engineer
Comcast

Reap the benefits of Android Studio

Sweety Bertilla
Principal Engineer
Comcast

Jobs

No results found.

YOU MAY BE INTERESTED IN

YOU MAY BE INTERESTED IN

blog
Using annotations in Kotlin has some nuances that are useful to know
READ MORE
blog
One of the latest trends in UI design is blurring the background content behind the foreground elements. This creates a sense of depth, transparency, and focus,…
READ MORE
blog
The ModalBottomSheet in Jetpack Compose is easy to use, it just pops up at…
READ MORE
blog
Discussions about accessibility, especially in software development, often center around screen reader accessibility. With…
READ MORE

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.

Menu