We've all done it: accidentally deleted photos, videos or files by accident. Don't panic, though. There are ways to recover your data whether you're rooted or not. Time is always of the essence though: do not save anything else to your device or switch it off until you attempt recovery. Turn off your Wi-Fi and 3G/4G connection so no automatic updates occur and overwrite your data before you've had a chance to recover lost data on Android.
Recover lost data on Android (if you are NOT ROOTED)
If you don't know what this means, you are most likely not rooted
Once you've checked the obvious - such as looking in the Trash of your photos app, which stores files you've deleted from your gallery until it's emptied - the next step is to connect your phone to a PC and run a file recovery app. However, there's one little problem with that: post-Ice Cream Sandwich versions of Android ditched the Mass Storage Protocol that made your internal storage look like a flash drive, so many tried and tested recovery methods won't work any more. Don't worry, though, because we've got a solution to that too.
If the file(s) you're looking for were on your memory card, you can use a Micro SD Card Adapter to attach your microSD via USB. Then download Recuva (you can use either the paid or free version), which is a program to recover files. You can also use other programs, like Coolmuster or Wondershare Dr. Fone (which requires root but is available for Mac or PC), but Recuva is a great free tool.
Note: Normally, for most of these programs to work, your memory must be formatted as FAT32, NTFS or similar. If your memory card format is not recognized for some reason, you can just do a complete copy of its contents to your computer, reformat the memory card as FAT32 and then dump the copied files back on it and continue the process.
When you run Recuva, the first thing to do is select the type of file you want to recover: Pictures, Videos, Music, Documents, etc. The option to restore from a specific location is available and you can even set a specific folder to attempt recovery from. Note that Recuva will only display locations it can actually recover data from. Just follow the prompts in the program.
Important: When you finish recovering your deleted files try to save them on a different device from the one on which they were originally lost: this can sometimes cause conflicts and damage recovery. So if you are recovering files from your smartphone, record them on the hard disk of the PC and then transfer them over later, once they're safe and sound.
If the file(s) were on your internal storage, don't worry: we can fix that too. If you haven't already enabled the developer options in Android, go to Settings > About Phone > Build Number (or your phone's equivalent; for example, on a Galaxy S5 it's Settings > About device > Build Number) and then tap the build number section seven times. Once you've done that, go into Settings > Developer Options and enable USB debugging. You should now be able to use an app such as Wondershare Dr Fone to scan your device.
Recover lost data on Android (If you have ROOT access to your phone)
The application is very simple. The first thing to do is to select the storage device from which you want to retrieve your data (can be internal or external memory).
Then you scan the selected device.
The process may take between 2 and 10 minutes, depending on your memory size and the amount of stored data.
When finished you will be presented with retrievable data in several tabs: Files, Pictures, Music, Videos, Documents and Files. Recovered data returns to its place of origin, ie wherever it was saved before they were lost.
This option may only work partially (if there is a problem with your memory). In that case, proceed to the Recuva steps above, or use Wondershare or another root recovery program.