How to factory reset a lenovo 15p laptop?

Basically, my friend screwed up his laptop, and its linux and windows are gone, and he wants to know how to completely factory reset his laptop with the keyboard

Make sure you back up all your files before doing this.

If your resetting a lappy, make sure you have the AC adapter plugged up. You do not want this process interrupted. This should take one or two hours. It is best to check on it to make sure everything is going fine.

If you can boot into Windows, click on start and then open your control panel. Then click Action Center, then click recovery. Then click on Advance recovery and select return computer to factory conditions. Answer any question and the system should reboot. Answer a few more questions and then it should go on autopilot and reset your system back to factory conditions.

If you can't boot into Windows then try Advanced boot options. When you press the power button, start tapping the F8 key. You will see the advance boot menu. Select repair your computer. (This option is available only if the tools are installed on your computer's hard disk.) Select your language and then enter your user name and password. Then click on (brand name) factory Image Restore and next. Answer the question and it should start the recovery back to factory settings.

Recovery from the recovery partition

When you press the power button start tapping the F11 key for your puter and that should open the recovery, answer the question and the recovery should begin. Depending on your puter this will take one to two hours.

Boot up using F8. Select recovery.