Same like hard resting WP8 - hold volume down while powering up the phone, then when you see the exclamation mark press these keys in sequence: Up, down, power, down.
I just hard reset my Lumia 520 with WP10. The process took a long time to finish (maybe an hour).
Not, it will FRESH install the LAST build you downloaded. If you want to restore by factory win 8.1, you NEED a pc and Windows Device Recovery (or Lumia Phone Test Application)