While Google has done an excellent job adding the much needed “undo” button to many aspects of Android in case you accidentally delete or swipe away a notification, we’ve all probably deleted a photo or an entire gallery by accident. The guide below will give you a few different routes to take in order to recover deleted photos from your Galaxy S5, Galaxy Note 4, or any other smartphone for that matter.

That uh oh feeling and instant anger you feel when you’ve deleted an entire photo gallery of an event, party or vacation is an awful one I’ve had before. Thanks to a recent unfortunate accident as the ones I’m describing above, I had to use some of the software below.

Don’t worry though, because you can actually recover deleted photos and even text messages off of your Android smartphone, as long as you act fast. Time is crucial in the event of this mistake, so read on for all the details.

Much like data recovery tools for computers the most important thing is to make sure you act fast and don’t write over the deleted content. Once an image, video, or text message is deleted it’s still technically on the micro-SD card or internal storage until something overwrites that deleted file and uses the space. There are multiple tools to recover them, so don’t be worried.

The two services I’ve heard good things about and used myself are Dr Fone for Android, and Android Data Recovery. These two tools are rather easy to use and support most files, not just pictures. This means if you act fast you’ll be able to recover almost anything.

Instructions

The first step is crucial. You’ll want to turn off WiFi, your Data, don’t take any pictures, or just put the phone into airplane mode. Essentially don’t do anything that will overwrite or write on top of the deleted files. From here you’ll need to download the software mentioned above and get started.

At first launch you’ll be instructed to connect your smartphone to your PC using a micro-USB cable, the one that came in the box will work fine. Or any USB to micro-USB will work. You’ll need to have USB Debugging enabled, which is in the developer options menu.

The guide above explains how to get the developer menu options. Start by heading into Settings > About Phone and tap the Build number about 5-7 times until it pops up saying you’re now a developer. Now at the end of settings is a developer options choice, tap this, then enable USB Debugging. You’ll see a notification at the bottom of the Dr. Fone program saying that USB Debugging is enabled and open.

From here simply follow all of the on-screen instructions and prompts from Dr Fone, which will start by having you connect USB and accept the RSA Key, then scan for files. From here it’s all rather easy, just select the files you’d like to recover. Multiple options are there for those interested, but we’re focused on photos.

To make things even easier once you’ve selected the content you’re looking for (we chose photos, or the “Deleted Files”) you’ll be able to preview the files before starting the actual data recovery on your Android device. They even have a selective mode where you can go in and simply restore select files, photos or video that you’re after, if you have some backed up already and are only looking for some specific images or text messages.

From here you’ll just let Dr Fone do all the hard work. Dr Fone may reboot your smartphone and display some odd things on the screen, but don’t touch anything and let it complete the process and recover your photos.

Once Dr Fone has finished this process and found any available data that hasn’t been overwritten, you’ll be able to select anything you want, or even select all, then just tap the “Recover” button on the bottom right as you see from the screenshot above. If you’re lucky you didn’t update any apps, browse through Facebook, or do anything that wrote over and permanently deleted your photos. This is where luck comes into play, and hopefully Dr Fone or the Android Data Recovery tool found and is able to restore your images.

Above is a guide so this will never happen again. There are multiple ways to have your Android smartphone or tablet automatically (and for free) backup all your photos right as you take them. This means if there’s an unfortunate event where you delete images in the future, they’ll be backed up to the Google Cloud, Dropbox, or any of the other backup tools mentioned in our link above.

These days these programs are increasing in popularity, and you may have to either try the free 30 day trial or pay to actually retrieve your deleted files. That said, this is worth it for many reasons, especially if you accidentally deleted a bunch of family photos or something valuable you’d like to get back.

Surely there are a few free options available as well, and many require root access (like Jailbreak) for Android, which isn’t something many average users know about. If you’re the average customer looking for data recovery, these two options are some of the best in the business. Good luck!