For iPad and iPhone, you can restore your Apple Account data after erasing the device by setting up the device as new, and then signing in to iCloud.
For Apple TV, you must erase and re-enroll the device as a new device.
Requirements
Ensure that iCloud on the device is synced so data (for example, calendars, contacts, or photos) is backed up as needed. For more information, see the following articles from the Apple Support website: