If you want to reset your cube with the original demo that came with it then you need to read this topic.
You'll find out everything you need to do in order to achieve this.
As for your other issue (timeout while flashing a viz) this can be caused by a number of things. Can you check that your photon is really connected, by looking at the LED located between the SETUP and RESET buttons (on the photon, not the baseboard) and confirm the LED is in connected state?
If you use Cube Doctor (article referenced above) then it should also restore your photon to this state after the process is finished.
If you find you're constantly having timeout errors, then maybe you might want to check if your internet connection is stable and reliable.