The Custom Droid

Android Tutorials, Tips and Tricks

Restore OnePlus 5T to Stock Firmware and Relock Bootlooader

Restore OnePlus 5T to Stock Firmware and Relock Bootlooader

If you’ve already unlocked the bootloader, installed TWRP recovery and rooted the OnePlus 5T, you can easily roll back to stock OxygenOS ROM. Follow this tutorial to restore OnePlus 5T to stock firmware by flashing the OxygenOS ROM and relock the bootloader.


OnePlus’ latest device has turned out to be one of the best smartphones released in 2017. Indeed, the improved short bezel design and powerful hardware is a complete package in the given price segment. Soon after the release, the developer community released TWRP recovery and root solutions for the device. And just over a month now, a small bunch of custom ROMs is already available for the device. In any case, if you want to restore OnePlus 5T stock firmware and bring it back to factory settings, then the steps in this guide will help you achieve that.

Restore OnePlus 5T to Stock Firmware and Relock Bootlooader
Restore OnePlus 5T to Stock Firmware and Relock Bootlooader

Page Contents

Guide to Restore OnePlus 5T to Stock Firmware

OnePlus is quite popular among the users at the moment. The part reason behind it is the developer-friendly nature of the devices. While most other OEM devices reject official warranty once the device is unlocked or rooted, that’s not the case with OnePlus. Users are allowed to freely alter the device or install custom ROMs, keeping in mind that it doesn’t produce any hardware damage.

If you’re reading this, it’s highly likely that you have already customized your OnePlus 5T using third-party firmware or root. But if you want to restore stock firmware on OnePlus 5T, then you can do so using the simple steps listed below. We will start off with installing OxygenOS ROM on the device using TWRP Recovery, followed by the steps to relock bootloader.

We have gathered a few situations that will lead you to restore OnePlus 5T to stock ROM.

  • Want to sell out the device.
  • Custom ROMs don’t suit you.
  • If you want to take OTA updates officially.

The process is fairly easy when compared to that of OEMs like HTC and Sony. So feel relaxed and follow each and every instruction as stated, and you shall be able to restore OnePlus 5T to stock firmware.


  • During this process, you will lose all the apps and their data. So make sure that you take a full backup of your OnePlus device. Follow our guide on how to take backups on Android devices.
  • Charge your OnePlus 5T to a sufficient battery level. This will avoid any sudden shutdowns during the restore process.
  • You must install Android SDK tools on your PC.

Once you have completed the listed requirements above, you can proceed below and restore OnePlus 5T to stock firmware.

Download OnePlus 5T Stock Firmware

Grab the full ROM package from the links below.

OxygenOS 9.0.8 (Android 9 Pie):

OxygenOS 9.0.7 (Android Pie):

OxygenOS 4.7.5:

OxygenOS 4.7.4:

How to Restore OnePlus 5T to Stock Firmware and Relock Bootloader

In the instructions below, we will first start off by installing the full ROM zip using TWRP recovery to restore OnePlus 5T stock ROM. Once that is done, you will be guided to relock the device’s bootloader.

Step 1: Install Stock OxygenOS Firmware on OnePlus 5T

  1. Long-press the power button on your device. Select ‘Power off’ » ‘Touch to power off’ in reboot menu.
  2. Now boot into TWRP recovery by holding the Volume Down + Power button altogether until you see the OnePlus logo.
  3. Your OnePlus 5T should now be in TWRP recovery mode.
  4. Go to ‘Wipe’ » ‘Format Data’ and enter ‘yes’ in the provided field to wipe the device completely. This also includes the internal storage, so make sure to take a backup first.
    Format Data in TWRP to Restore OnePlus 5T to Stock Firmware
    Format Data in TWRP to Restore OnePlus 5T to Stock Firmware
  5. Go to the ‘Mount’ menu in TWRP and press the ‘Enable MTP’ button.
    Restore OnePlus 5T to Stock Firmware - Enable MTP
  6. Connect your OnePlus 5T to the PC.
  7. Download the full ROM package from the links above. Copy the ROM zip (e.g. to the internal storage.
  8. Once the file has been transferred, disconnect the phone.
  9. In the TWRP main menu, press the ‘Install’ button. Navigate to the location where you have transferred the file.
  10. Select the full ROM zip and swipe the button to restore OnePlus 5T to stock firmware.
  11. The process will automatically replace the current TWRP with stock Oxygen recovery.

Now, if you wish to relock bootloader on OnePlus 5T, go to ‘Reboot’ menu and select ‘Bootloader’. Then skip to Step 2. If not, then simply hit the ‘Reboot System’ button.

Step 2: Relock OnePlus 5T Bootloader

The final step to restore OnePlus 5T to factory settings is by locking the bootloader.

  1. While your device is in Bootloader Mode, connect it to the PC.
  2. Go to the C:\adb folder where all the ADB and Fastboot binaries are present.
  3. Hold the SHIFT key and right-click inside the folder.
  4. Select ‘Open command window here’ or ‘Open PowerShell window here’ from the menu.
  5. Now relock the bootloader by entering the following command:
    fastboot oem lock
  6. Your phone shall instantly display a bootloader lock confirmation message.
    Relock Bootloader on OnePlus 5T
  7. Use the Volume keys to highlight ‘Yes’ and then press the Power button to relock bootloader on OnePlus 5T.
  8. Finally, reboot your device using:
    fastboot reboot

Your OnePlus 5T should now boot into stock OxygenOS with a locked bootloader. You can go ahead, set up your device and start using it. This method will prove useful in several situations.

There you go! You have just been able to restore OnePlus 5T to stock firmware, stock recovery and relock the bootloader too. If you have any queries regarding the process, let us know through the comments.

About the Author

Founder and Editor-in-Chief

Dhananjay has more than 11 years of experience in Android software customization and development, and has spent the past 10 years writing about it. He spends most of his prime time reading, learning and writing about Android and other open-source projects. He is also a community-taught web developer. Apart from that, he loves mountain biking and playing video games on his PlayStation.

Comments 6 Comments

  1. This is the most easiest guide I’ve found on the internet, thank you for explaining the process in the easiest way possible.

    1. Hi Vikky. Thanks a lot for such kind words. These are what keep me going!

    1. I’m currently on a pie custom rom will the above steps work if i want to migrate back to oxygen os 9, since it has some kind of project treble right

    2. Hi Ashish. Yes, it will work. Project Treble was introduced for OnePlus 5/5T with OxygenOS 5.1.5 and carries on above with every OxygenOS Update incl. version 9.

Leave a Reply

Comments are moderated, and published only if they are relevant to the topic and add value in a constructive way. If you disagree with something, please be polite and respectful. We suggest you read our comment policy before commenting.