How to Factory Reset an iPhone Without Apple ID Password
When you try to reset an iPhone to factory settings, you’ll be asked in most cases for an Apple ID password before the iPhone erases. If you don’t know the password you can try recovering it. Here’s how.
Source: howtogeek.com