Although there are various reasons to keep an Android phone rooted, most people root their phone just for flashing custom ROMs. However, after flashing few ROMs, most of them decide to unroot the phone and return to the stock ROM, so they will get back the official firmware update as well as warranty return.
In many instances, the simplest way to unroot and return to stock is just to flash a stock ROM. This would be done using the same method you used to root in the first place. For example, by using Odin on Samsung Galaxy devices and Fastboot on Nexus phones.
To flash a stock ROM, you can either use your Nadroid backup or download ROM from specified sources. For instance, for Nexus devices you can download ROM from here, for Samsung Galaxy devices you can download ROM from here and for Sony Xperia devices, you can download ROM from here. Also, it is a good idea to perform a factory reset after flashing a stock ROM.
Another way to unroot a phone is using unrooting toolkit. Most rooting toolkits (for instance, one-click toolkit) has also provide an unroot option. But unfortunately, it may not always remove all traces of rooting and modding from your device, so you won’t get back firmware update or warranty.
For instance, In the case of the Samsung Galaxy range of devices, it records the number of times a ROM has been flashed, which remains even after you have returned the device to stock, so an extra step is required to remove all traces after unrooting Galaxy devices.
To resets this ‘flash counter’ and to get the official firmware update as well as warranty return, you can use an app called Triangle Away. It is designed to resets the ‘flash counter’ on Galaxy devices. Note that, though it is easy to do, but since the process itself is not simple, it is essential that you follow the instructions given when using Triangle Away.
Also, there are few applications that claims to unroot any Android phone and remove all traces of rooting, hacking and modding you have done on your phone. For instance, the Universal Unroot tool, which claims that it can reset flash counter on Galaxy range of devices.
Hope the above information will help you to unroot your phone, if you decide so!