This project shows you how to create a HBridge with transistor allowing motor rotation in both directions

Switching on Q1 and Q4 transistors allow to rotate the motor in one direction. Otherwise, with Q2 and Q3 on, the motor will rotate in the other one. Diodes are protecting the circuit against flyback current.