Unfortunately the MCH does not warn user enough (it should be in bold red letters) and there is no easy way to recover data. It does give a warning
Are you sure you want to detach from My Cloud Home xxx device?
Proceeding with detaching device will permanently delete all of the data on your
current My Cloud Home device. There’s no going back. Ever. You can’t undo this
action.
After detaching from your device it will be not available in My Cloud Home app.
Also you will be signed out of your account to complete the detach process Are
you sure you want to proceed with detaching from this device?
DETACH FROM THIS DEVICE
If there is no better way, you can always take the disk out of the enclosure, put it in a Linux computer, mount the partitions and copy your data off of it.
Then you can put it back in the enclosure and safely reset & erase to reattach.