Yes, on a phone that is not jailbroken, hitting that toggle just removes all the custom content you have added to your phone (settings, apps, music, the like). This cannot replace any corrupted firmware files (if you would have any)
Restore, set up as new, don't restore to backup gives a pristine clean install of the firmware.