When you’re rooting, flashing custom ROMs, and otherwise playing with Android’s system, there are a lot of things that can go wrong. Before you start, you should know how to back up and restore your phone with the TWRP recovery environment.
TWRP makes “nandroid” backups, which are near-complete images of your system. Instead of using them to restore individual files or apps, you use nandroid backups to restore your phone to exactly the state it was in when you backed up: the version of Android, your wallpaper, your home screen, right down to which text messages you had left unread.
That means nandroid backups won’t work if you’re only trying to restore certain elements. If you want to restore the apps from your old ROM onto your new ROM, for example, you’ll need to use something like Titanium Backup instead. TWRP is meant to back up and restore the entire system in full.
Whenever you start messing with Android’s system–rooting, flashing custom ROMs, and so on–you should first make a nandroid backup in TWRP. That way, if anything goes wrong, you can restore your phone to its pre-broken state.
How to backup your phone with TWRP
Step 1- Boot into recovery mode by pressing Power+ Volume up button.
Step 2- Click the Backup button.
The following screen will appear.
Step 3- Tap the “Name” bar at the top to give the backup a recognizable name. I usually use the current date and what I was doing when I backed up–like
2016-01-25--pre-cyanogenmod. Check the Boot, System, and Data boxes, and then swipe the bar along the bottom to back up.
NOTE: Backups are fairly large, so if you get an error about there not being enough space, you may have to delete some things on your internal storage or SD card before continuing.
The backup will take a few minutes to complete, so be patient. When it’s finished, you can tap “Back” to go back to TWRP’s main menu, or “Reboot System” to reboot back into Android.
If TWRP asks if you want to root your phone, choose “Do Not Install”. It’s best to flash the latest version of SuperSU yourself rather than having TWRP do it for you.
How to Restore from a Nandroid Backup in TWRP
If you ever need to restore from a previous backup, it’s simple.
Step 1- Boot back into TWRP.
Step 2-Click on the “Restore” button on the home screen.
TWRP will show you a list of your previous backups.
Step 4- Select the backup file which you want to restore.
Make sure all the boxes are checked and swipe the bar to restore.
The restore will take a few minutes, but when it’s finished, you can reboot your phone back into Android.
Once again, if it asks you to root, be sure to tap “Do Not Install”.
When you return to Android, you should find that everything is exactly how you left it when you made that backup.