Uploading a different sketch, like blink, should clear the problem. If not you have some other problem then just what you did in this sketch. A reset forces all I/O pins to input mode, so uploading a new sketch 'erases' any prior pin mode setup from a prior sketch.
Lefty