You do a factory reset, which will cause you to lose all data and do as stated, reset it back to factory new.
Power the device off, hold down volume and power button and select factory reset.
Hopefully you see this in time. After a certain number of attempts it will prompt you for the GMail password. If it is an Android.