A factory reset completely erases all data, including login credentials and security passwords. However, if you’re locked out of your phone, you won’t be able to factory reset it without getting into the phone and giving it permission to do so.