Well, i suggest not to, but if you want to do that and done once before, so it means that you have an unlocked bootloader, so just turn off phone , hold vol down and power to go to Fastboot mode, the connect the phone to the pc and in CMD opened from the fasboot and adb folder, type
fastboot...