The best way to factory reset a DEP device is to do the following in the Device Console:
- Settings > System > enable Re-enroll Apple devices in the previous device group > Save
- Devices > click on the name of the device group > put a check in the box next to the iPads you wish to factory reset > Select the Erase Device button at the top of the list.
- Enable Clear Activation Lock
- Enable Delete Devices from Device Console
Once the device factory resets, follow the prompts and the device will be enrolled back into the Device Console.