The original question was the wiring.
Assuming a 12V or similar motor, you need a 2-pole changeover also known as a 2-pole double throw switch (2PDT).
This has six terminals, typically arranged as two rows of three:
1 2 3
4 5 6
A quick check with a multimeter (or a battery, bulb and bit of wire) will show that he effect of the switch is to short the middle pins (2 and 5) to either 1 & 4 or 3 & 6, depending on the direction of the switch toggle.
Connect battery + to 2 and battery – to 5
Connect one side of the motor to 1 and 6
Connect the other side of the motor to 3 and 4
The switch will now act to reverse the motor
An on/off switch in one of the battery leads will provide your on/off facility
If you want a limit switch to stop the motor at each end of its run the then fit one of these between 1 and the motor and the other between 6 and the motor.
Test the limit switches,and if the motor stops when heading away from them reverse the battery connections.
Neil
