You say you were messing around with your endstops. Depending on your firmware settings, the printer may refuse to move if it thinks it is at both the X MIN and X MAX endstop.
If you send an M119, what is the ouptut?
I can see this being the case if you have your X/Y endstops misconfigured but Z is fine.
Also what jbernardis said, never attach or detach the motor or stepper while it is powered, a quick way to fry the driver.