How to recover deleted Android Studio project

Michaelpeer
Nov 2, 2020

Earlier in this week, I ran into a serious problem — I accidentally deleted my android project. I mean, It was totally my stupid mistake, but hey, we learn from those stupid mistakes.

I pushed the project to github one week ago, So I had one about one week of lost code. I probably could have recreated the code, but It will be very tedious and time consuming job.

I looked into the usual suspects — windows restore points and recovery softwares. but Murphy kicked in twice.

As for the restore points, I didn’t have any. Oh, my mistake, I did have one — restore point when I installed the first recovery software.

As for the recovery softwares, I didn’t have much luck either. They found files from decade ago, but files deleted 20 minutes ago? Oh, this was too hard for them.

On the verge of despair I came across the most amazing tool I ever seen so far by Android Studio time — “Local History”.

Let’s say you have Android studio project called “MyAmazingApp” under “Apps” folder, and you deleted the whole folder without option re restore it. All you need to do is to create folder with the SAME NAME as the deleted one, clone the project from github and open the project with your not-so-updated code.

Then, right-click -> Local History and you’ll prompt with this screen:

Local History screen

Now, all you need to do is to search in the right side the last time you pushed your project to github, and click revert the latest change:

That’s it. you have your project restored.

--

--