First of all rooting is revertible, you can even unroot an installation without any side effect aside from root-based-functions being lost
and if all else fails a clean install (not just reset) will always put everything back on stock.
My procedure for rooting :
- Bootloader is unlocked
- Xiaomi PC driver is installed
- Magisk app installed on phone
- platform tools from Google installed on PC
1. Patch init_boot.img (must be the one coming with the ROM you have installed) with Magisk app and copy patched image to PC
2. Boot phone to fastboot mode
3. Flash modified image with "fastboot flash init_boot_ab <magisk-image-name>"
4. Reboot phone
5. Setup Magisk (if you don't see Magisk app just reboot again), this will require another reboot to fully install Magisk
6. Enable Zygisk and hide Magisk app by changing name
7. Install Magisk module "systemless hosts"
8. Install current Shamiko module
9. Install current LSposed module
10. Important: reboot after each step 6-9!
11. Install Hide my Applist xposed app, enable and reboot.
12. Setup HMA as described here
13. Force-stop and Clear data for the following apps:
-all critical apps like Wallet, Banking-Apps etc
14. Reboot and re-setup all those apps
Now you should be good to go....
If you want to fully remove root just select the "uninstall Magisk" Option in Magisk App, Boot to fastboot and flash original init_boot.img as in Step #3, reboot and uninstall all root-related apps. Most probably you have to go through steps 13+14 again...
For each ROM update go through 1-4 again, no need for the rest...