If you're lucky then the speedo cable may still be lined up with the back of the clocks, mine did this so every now and then the needle would go mad then stop working.
Simple technique I used was to pop the bonnet, find the speedo cable where it passes thru the bulkhead and gently push it thru more. The cable is strong enuff not to bend so it simply clipped itself back on and its been working fine ever since.

This'll only work if the connectors are still touching though as otherwise you'll just push the cable past the connector and against the back of the clocks :
