Did you compile your own firmware? (I know Marlin has options for defining the home position of an axis, and also the direction of it. For example, the X axis on my printer is mounted backwards on the machine (motor on rightside of mendelmax), and I home it to X=220. If I didn't have this set correctly, X would be mirrored on my machine.)
Anyway, if you compiled your own firmware I'd check the axis inversion settings in its configuration.
If it's flipped right-left, that's X, else Y is front-back.