Remove the grills and burner covers from the stove top.
Unscrew the cabinet doors beneath the stove top using a screwdriver. Remove the cabinet doors with the hinges still attached, so that reattaching the doors will only involve screwing the hinges back into the cabinet. Set the cabinet doors aside, with the screws in a baggy. Remove any drawers beneath the stove top so that you have an unobstructed view of the underside of the stove top.
Unplug the stove from the outlet.
Turn off the gas supply beneath the stove by rotating the knob until it is perpendicular to the orientation of the gas line. If you're not sure if the gas is off, spray the gas pipe with soapy water, then loosen the connection with a plumber's wrench. If bubbles form on the pipe connection, gas is leaking from the pipe and the gas has not been turned off.
Loosen the connections of the flexible gas pipe under the stove with a plumber's wrench. Detach the flexible pipe from the gas supply. Leave the pipe attached to the underside of the stove top.
Unscrew the stove top from the metal brackets in the counter. The brackets are on the underside of the counter top. Save the screws.
Lift the stove top and turn it around so that it faces the opposite direction in the hole on the counter top.
Spread pipe sealant around the gas supply pipe, using a cheap paintbrush. Screw the flexible gas pipe into the gas supply with a plumber's wrench.
Turn on the gas supply. Spray down the connection between the flexible pipe and the gas supply with soapy water, to check for gas leaks. If there is a leak, tighten the connection until it is fixed. Wipe off any water with a rag.
Screw the stove top back into the metal brackets beneath the counter top. If the metal brackets no longer fit into the holes beneath the stove top because its orientation has changed, you will need to unscrew the brackets and reposition them accordingly. If you need to unscrew the brackets, use a power drill to make new pilot holes beneath the counter.
Plug the stove back into the outlet. Replace the grill and burners, then turn the stove on to check that everything is functioning properly.
Screw the cabinet doors back on.