How to Remove TWRP and Return Factory Recovery to Xiaomi Redmi

Installing custom recovery TWRP on Xiaomi Redmi smartphones opens up opportunities for system modifications, from root rights to installation of unofficial firmware. However, sometimes users face the need to return the device to a factory state - for example, before sale, for warranty repairs or after unsuccessful experiments with software. Unlike a standard reset through settings, removing TWRP requires a comprehensive approach: it is not enough to simply flash stock recovery, you also need to consider the status of the bootloader, the MIUI version and possible locks from Xiaomi.

This article will examine in detail all the stages of the process: from tool preparation to the final test of the device’s health. We will look at two main scenarios – with unlocked and locked bootloader, and also warn against the typical errors that can turn a smartphone into a β€œbrick”. 10/11/12, Redmi 9/9A/9C and other popular lines, but the instructions are adapted for new devices 2023–2026 year-end.

Why You May Need to Remove TWRP

Castomic recovery TWRP is a powerful tool, but it's not always warranted on the device. Here are the most common reasons to return to drain recovery:

  • πŸ“± Warranty Repair: Xiaomi Service Centers Denie Warranty When Modified Software Is Detected, Including TWRP.
  • πŸ”„ Updates MIUI airborne (OTA): Stock updates are often not installed on custom recovery devices due to signature mismatch.
  • πŸ’° Phone sales: Customers prefer β€œclean” devices without any modifications, especially when it comes to used technology.
  • πŸ› οΈ Unstable System Operation: Incorrectly Installed TWRP or conflicting Magisk modules can cause freezes and reboots.
  • πŸ”’ bootloader lock: Xiaomi periodically tightens security policies, and some devices after the update MIUI Automatically lock the bootloader, making TWRP inaccessible.

It is important to understand that simply removing TWRP via fastboot flash recovery doesn’t always solve the problem. For example, if you previously obtained root rights through Magisk, traces of them may remain in the system partition /system or /vendor. In such cases, you need to completely flash the device through the Mi Flash Tool and clean all partitions.

⚠️ Attention: On devices with a locked bootloader, try to flash stock recovery over TWRP Make sure the bootloader is unlocked before starting the procedure, or use the official method via the Mi Unlock Tool.

Preparation for resetting: what will be needed

Before you start removing TWRP, prepare everything you need, and the absence of at least one of the components can interrupt the process and cause the device to fail.

  • πŸ–₯️ Computer running Windows 10/11 (The Mi Flash Tool is required for Windows; macOS/Linux not officially supported).
  • πŸ”Œ Original. USB-Cable: Cheap cables may not provide stable fastboot connection.
  • πŸ“‚ Stock firmware for your Redmi model (.tgz or.zip format). Download only from official sources: Official website MIUI (Download section) Xiaomi Firmware Updater (alternative source with archived versions)
  • πŸ› οΈ Tools: Mi Unlock Tool (if the bootloader is locked), Mi Flash Tool (for full firmware) Platform Tools (for fastboot commands)
  • πŸ”‹ Battery charge at least 60%. Fastboot firmware discharges battery faster than usual.

For Qualcomm-based Redmi models (e.g. Redmi Note) 10 Pro or Redmi K40) You may also need a firehose file (prog_emmc_firehose.mbn) recreating EDL-It can be extracted from official firmware or found on topical forums like XDA Developers.

πŸ“Š What Xiaomi Redmi model do you use?
Redmi Note 10/11/12
Redmi 9/9A/9C
Redmi K40/K50
Redmi 8/8A
Another model

Step 1: Checking the status of the loader

The bootloader status is a key factor in determining the algorithm of actions. If it's locked, a simple firmware for stock recovery won't work.

  1. Turn off the phone.
  2. Press the Power button + Volume down to log in to fastboot.
  3. Connect the device to your PC and open the command line in the folder with the platform-tools.
  4. Enter the command: fastboot oem device-info

In the answer, find the lines:

  • Device unlocked: true - the bootloader is unlocked.
  • Device unlocked: false – the bootloader is locked.

If the bootloader is locked, it must be unlocked through the Mi Unlock Tool. Note that Xiaomi has introduced a restriction: after unlocking, you can not immediately lock the bootloader back - you need to wait 7 days (on some models - up to 30 days), This rule applies from 2022 and applies to all devices released after the Redmi Note 9.

⚠️ Note: On devices with MediaTek processor (e.g. Redmi) 10C or Redmi 9A) Unlocking the bootloader through the Mi Unlock Tool may not work. MTK Bypass or SP Flash Tool, but it requires more knowledge.

Enable debugging over USB in the developer settings |

Link your Mi Account to your device |

Download the Mi Unlock Tool of the latest version |

Connect your phone to fastboot |

Run Mi Unlock Tool on behalf of the administrator-->

Step 2: Remove TWRP on unlocked bootloader

If the boot boot boot is unlocked, the process is simplified. You need to flash the stock recovery and, if necessary, restore the original boot.img. Here is the step-by-step instruction:

  1. Download the stock recovery for your model. It is usually included in the official firmware (recovery.img file in the image archive).
  2. Place recovery.img in the folder with the platform-tools.
  3. Connect your phone in fastboot mode and execute the command: fastboot flash recovery.img
  4. For reliability, also swipe the original boot.img (if you modified it for root rights): fastboot flash boot.img
  5. Restart the device to recovery to check the result: fastboot reboot recovery

If you see a stock recovery menu after the reboot (with the MI logo and items in Chinese/English), then TWRP has been successfully removed. However, this method does not clear user data. If you need to completely reset your device, run Wipe Data in drain recovery or use the Mi Flash Tool for a clean MIUI installation.

What to do if the phone does not turn on after the recovery firmware?
If the device is stuck on the logo MI or left in bootloop, the reason may be incompatibility of versions boot.img and recovery.img. Solution: Download the full firmware (.tgz) for your model and version MIUI. Unpack it and swipe through all sections through fastboot with a flag --slot=all (for devices with A/B-Use the fastboot command. --disable-verity --disable-verification flash vbmeta vbmeta.img, If there are errors of verification.

Step 3: Complete reset via Mi Flash Tool (for locked bootloader)

If the bootloader is locked or you want to return the device to a completely factory-like state, you will need full firmware through the Mi Flash Tool, which erases all data, including internal memory (userdata), and restores the original partitions.

Instructions:

  1. Download the full firmware (.tgz) for your model from the official website. Pay attention to the region (Global/China/EEA) - it should match the current firmware of the device.
  2. Unpack the archive into a folder without Cyrillic characters in transit (e.g., C:\MIUI\).
  3. Install the Mi Flash Tool and Xiaomi drivers (they are usually installed automatically when you first connect to fastboot).
  4. Connect your phone in fastboot mode and launch the Mi Flash Tool on behalf of the administrator.
  5. In the program: Press Select and select the folder with the unpacked firmware. At the bottom, select Clean All or Clean All and Lock mode. + Press Flash and wait until it is completed (usually 5-10 minutes).

On Qualcomm-powered devices (such as the Redmi Note 10 Pro) the bootloader will lock immediately after the firmware is installed, but on some 2023+ models, an additional wait of 7-30 days before re-unblocking may be required.

Firmware modeClears the data.Locks the loader.When to use
clean allβœ… Yes.❌ No.To remove TWRP without locking the bootloader
clean all and lockβœ… Yes.βœ… Yes.For a full return to factory condition (warranty, sale)
save user data❌ No.❌ No.Only for MIUI updates without reset (not suitable for TWRP removal)
  1. Reconnect the phone to another USB-port (preferably 2.0).
  2. Run the Mi Flash Tool in Windows 7 Compatibility Mode.
  3. Install drivers manually through Device Manager (select "Xiaomi Composite MDB Interface").
  4. Test OTA-Updates: Go to Settings β†’ The phone. β†’ Update system: If updates are downloaded and installed without errors, there are traces of TWRP removed.

Typical problems and their solutions:

  • πŸ”„ Bootloop after firmware: The reason is version incompatibility boot.img And vbmeta. Solution: vbmeta.img flag-headed --disable-verity.
  • πŸ“΅ Not included after "clean all and lock": On some models (e.g. Redmi) K50) bootloader lock requires additional authorization through the Mi Account. Solution: Unlock the bootloader again.
  • πŸ”Œ Mi Flash Tool doesn't see device: The problem is drivers or cable.Solution: Use the original cable and port USB 2.0.

πŸ’‘

If after all the manipulations the phone does not turn on or stuck on the logo, do not try to stitch it again without diagnosis. 80% of the time the problem is solved through the use of a computer. EDL-mode (emergency firmware), but this requires special tools and knowledge.

Additional measures: cleaning of traces of Magisk and modifications

Even after removal TWRP In the system there may be traces of modifications that interfere with the work OTA-updates or cause errors. Here's how to fix them:

  1. Delete Magisk: If you had a root, download Magisk Uninstaller (file) uninstall.zip). Fastboot: Fastboot Flash Boot or Fastboot Recovery magisk_uninstaller.img
  2. Restore dm-verity: If you have disabled partition verification, return it with the command: fastboot --disable-verity flash vbmeta vbmeta.img

Cleaning /data and /cache

  • In the stock recovery, select Wipe Data β†’ Wipe All Data.
  • This will delete all user files, but it is guaranteed to clear the traces of modifications.