There is an extra 12 page manual for the 500c, which should have been provided. Have a look through your documents in case you've missed it - it's just a thin leaflet so easy to overlook.
Instructions for the roof re-set are as follows:
Initialisation Procedure
The soft top must be re-initialised after disconnecting the battery or if the relevant protection fuse is blown (which I guess has happened to you?).
Proceed as follows:
make sure the motor is running during the whole initialisation procedure
keep the opening button pressed until the soft top is completely open
when the soft top is completely open, keep the button pressed for at least 2 seconds
keep the closing button pressed until the soft top is completely closed
when the soft top is completely closed, keep the button pressed for at least 2 seconds
When the procedure is terminated, the soft top will automatically carry out a complete opening and closing cycle (up to 25 cm from the completely closed position) to inform the driver that correct operation has been restored.
Hope this helps!