Rooting an Android phone gives you much more control, but often the procedure invalidates the device's warranty and complicates the resolution of any problems. Fortunately, restoring the original configuration ("unroot") of most Android devices requires only a few simple steps. Things get a little complicated for Samsung Galaxy devices, but by using the correct tools you will still be able to fix all the problems in minutes.
Steps
Method 1 of 3: Manual Unroot

Step 1. Open your device's file manager
On the Google Play Store there are numerous programs that allow you to completely manage the file system of your Android device. Popular file managers include: "Root Browser", "ES File Explorer" and "X-Plore File Manager".

Step 2. Navigate to the following / system / bin / folder

Step 3. Locate and delete the file named su
To do this, press and hold the file in question, then choose the "Delete" option from the context menu that appears. Depending on the process of rooting the device, the su file may not be present.

Step 4. Navigate to the / system / xbin / folder

Step 5. Again, delete the su file

Step 6. Navigate to the / system / app / folder

Step 7. Delete the Superuser.apk file

Step 8. Restart your device
The procedure described in this section should restore the device to normal operation after the reboot is complete. To make sure that the "unroot" process was successful, you can download the "Root Checker" application available on the "Play Store"
Method 2 of 3: Use SuperSU

Step 1. Launch the "SuperSU" application
If you have not installed a "custom recovery image", to unroot the device, you will need to use the "SuperSU" application.

Step 2. Go to the "Settings" tab of the application

Step 3. Scroll through the list that appeared looking for the "Cleanup" section

Step 4. Tap the "Full unroot" option

Step 5. Read the instructions that appeared and press the "Continue" button to proceed further

Step 6. Reboot the device when the "SuperSU" application is closed
In most cases the "unroot" process will run smoothly. Some custom firmware automatically "root" the device at the next reboot, making this procedure ineffective

Step 7. If this method doesn't work, use a dedicated application to perform the "unroot" process
The "Universal Unroot" application, available on the Play Store, works on a wide range of Android devices. This is a paid app that can be very useful, however, and the cost of which is $ 0.99. Unfortunately this application does not work in the case of Samsung devices (in this case, continue reading the next section).
Method 3 of 3: Unroot of Samsung Galaxy Devices

Step 1. Download the original firmware of your device
To be able to unroot Samsung Galaxy devices, you need to have the original firmware (in the case of devices distributed directly by mobile carriers, you will need to use your carrier's custom firmware). You can download this file directly online. Search the web using the engine of your choice, based on the model of your Samsung device and the carrier in use. Remember to also add the search string "stock firmware". After downloading the firmware file, unzip it to locate the.tar.md5 file.
Note: This method does not reset the "KNOX" counter, a tool through which Samsung keeps track of changes made to its devices. Currently it is possible to "root" Samsung devices without changing the "KNOX" counter, but if you have used one of the old methods available it will not be possible to restore the original "KNOX" state

Step 2. Download and install the "Odin3" program
It is a development tool for Android environments that allows you to upload the original firmware directly from your computer to your Android device. You can find the installation file in the XDA forum available at this link.

Step 3. Download and install the drivers for your Samsung device
If you have never connected your phone to your computer before, you need to install the "Samsung USB" driver first. The easiest and fastest way to download the installation file is to use this link. Download the ZIP file, unzip it by selecting it with a double click of the mouse and extract the installation file. At this point, run the extracted file to install the drivers.

Step 4. Turn off the device completely
To proceed with the reset, you will need to start it in a special mode of operation.

Step 5. Press and hold the "Home" and "Power" keys and the volume down button at the same time
The device will start in "Download" mode. You will now be able to connect it to your computer via USB cable.

Step 6. Start the "Odin3" program
On the left side of the "ID: COM" section, there should be a green colored box. Otherwise, the "Samsung USB" driver will not have been installed correctly.

Step 7. Press the button
PDA placed on the interface of "Odin3".
Locate the.tar.md5 file for the firmware you downloaded in the previous steps.

Step 8. Check the "PDA" and "Auto Reboot" check buttons, making sure the others are all unchecked

Step 9. To start the "unroot" process, press the button
Start. This procedure should take approximately 5-10 minutes to complete. At the end you will see the word "PASS!" in the box at the top of the program interface. The device should reboot normally by loading Samsung's proprietary operating system, "TouchWiz".

Step 10. Restore factory settings
If after loading the original firmware, the device continues to reboot, you will have to proceed with a factory reset. This procedure will delete any data on the device.
- Press and hold the "Power" button to turn off your smartphone.
- Press and hold the "Home" and "Power" keys and the volume up button at the same time. The device will boot into "Recovery" mode.
- Use the volume rocker to select the "wipe data / factory reset" menu option, then press the "Power" button to proceed.
- Choose the "wipe data partition" option and then select the "reboot system now" item. The device will reboot, all existing data will be erased and the original factory settings will be restored.