How to go back to MIUI from Cyanogen mod? I recently installed Cyanogen mod 14.1(7.1.1) on Mi5(gemini) and now I want to go back to MIUI (preferably MIUI global developer rom) and lock the bootloader. I have to tried to flash using the existing TWRP and also using the inbuilt fastboot mode, but was not successful. I can neither find a proper flashing guide nor the proper files required to flash. Is there something I am missing?
If you haven't saved a backup with TWRP you have to reinstall the MIUI.

First of all download the ROM here.

Then put the ROM in a USB drive or SD card (it has to be read from the smartphone outside its own disk).

Then, install the ROM.

You can follow these steps from How to Flash a New ROM to Your Android Phone

But if you have a saved backup with TWRP, go to restore and select your backup.