Assuming that you mean that the motor is spinning in the opposite direction you want, and assuming you are using a Brushed DC motor, which is the most common for hobbyists, it is very simple: swap the wires. If you are using a stepper motor, you'll have to change either the physical connections according to the excitation order required to turn the motor in order to get the desired direction, or switch the order in which the coils are excited in code. I doubt you are using an AC motor or a brushed DC, but if you are, they usually come with a driver circuit, whose datasheet will guide you on reversing the spin direction.