Here is the guide to Hard reset Motorola Q

To perform a hard reset, hold down the center select key (s) for
5 seconds while turning the phone on.

Master reset

Resets all options except the carrier
security code, and lifetime timer:
Press Start > System Tools > Master Reset