You can update iPhone software in Settings, or by using iTunes. You can also erase or restore iPhone, and then use iCloud or iTunes to restore from a backup.

Deleted data is no longer accessible through the iPhone user interface, but it isn’t erased from iPhone. For information about erasing all content and settings