Rooting gives you more control over your device, but it also usually voids the warranty and makes repairing problematic. Fortunately, you can quickly unroot on most devices with a few simple steps. Things are a bit trickier on the Samsung Galaxy, but with the right tools, it will only take you a few minutes.
Steps
Method 1 of 3: Manually unroot

Step 1. Open a file manager on your device
There are many file managers available on the Play Store. You can use them to browse through the root files of your Android device. The most well-known file managers are Root Browser, ES File Explorer, and X-Plore File Manager.

Step 2. Find and press / system / bin /

Step 3. Find and delete the file named su
Long press the file and then select To delete in the menu that appears. You may not find any su files here depending on how you rooted your device.

Step 4. Press / system / xbin /

Step 5. Also delete the su file

Step 6. Find and press / system / app /

Step 7. Delete the Superuser.apk file

Step 8. Restart your device
The method described above should unroot your device after you restart it. You can make sure this is the case by downloading and launching the Root Checker app from the Play Store
Method 2 of 3: Use SuperSU

Step 1. Launch the SuperSU app
If you haven't installed a custom recovery image, you will need to be able to use the SuperSU app to unroot your device.

Step 2. Tap the Settings tab

Step 3. Scroll down to the screen
Go to the Cleaning section.

Step 4. Tap Complete Root Removal

Step 5. Read the confirmation request
Press on To continue.

Step 6. Restart your device
When you close SuperSU, you will be able to restart your device.
On most devices, doing this removes the root, but some custom firmware images automatically root the device on startup and this process will be of no use

Step 7. Use an app
If this method fails, you will need to use an application to unroot. The Universal unroot app, available on the Play Store, can unroot many Android devices. It costs 0, 99 euro, but can be very useful. This app does not work on Samsung devices (read next section).
Method 3 of 3: Unroot Samsung Galaxy devices

Step 1. Download the stock firmware for your device
To unroot your Galaxy device, you will need the stock firmware corresponding to its type and model. You will find this firmware on many online sites. Use a search engine and find the type and model of your Galaxy with the phrase “stock firmware”. Unzip the firmware after downloading it to find the file. tar.md5.
Note: This method does not reset the KNOX counter, which is a way for Samsung to know if the device has been rooted or changed. It is currently possible to root without triggering this counter, but if you have rooted your device with older methods, there will be no way to reset it

Step 2. Download and install Odin 3
This is a development tool for sending stock firmware from your computer to your Android device. You can find the installation files on the XDA forum dedicated to Odin here.

Step 3. Download and install the Samsung drivers
If you have never connected your device to your computer before, you will need to install Samsung USB drivers. The fastest way to do this is to download the drivers from this site. Download the ZIP file and double click it to open it before extracting the installation file. Run the installation to install the drivers.

Step 4. Turn off your device
You will have to restart it in a special mode.

Step 5. Boot into Download mode
Press and hold the volume down, home, and power buttons. Your device will start up in Download mode. Connect it to your computer by USB.

Step 6. Launch Odin 3
You should have a green box to the left of the "ID: COM" section. If you don't see it, your Samsung's USB drivers are not installed correctly.

Step 7. Click
PDA in Odin 3.
Go to the stock firmware file. tar.md5 that you downloaded.

Step 8. Check the PDA and Auto Reboot boxes
Make sure all other boxes are unchecked.

Step 9. Click
Start to start the process.
The operation may take 5-10 minutes, but when completed you will see “PASS! In the box at the top of the application. Your Galaxy should start up with the usual TouchWiz system.

Step 10. Restore factory values
If your device is the victim of a loop boot after unrooting, you will need to restore factory values. Everything on it will be deleted.
- Press and hold the power button. Your device will turn off.
- Press and hold the volume up, home and power buttons to boot into Recovery mode.
- Use the volume buttons to select "wipe data / factory reset". Press the power button to confirm the selection.
- Select "wipe data partition" then "reboot system now". Your Galaxy will restart, all data on it will be erased, and the settings will return to their factory default.