If you don't want to do it via firmware, just flip the steppers cables in the ramps board. That will fix the issue of your axis going in the wrong direction.
If you want to do it via firmware, just invert the direction in configuration h file and re flash it to the mega board.
Now, before you end up damaging your printer use pronterface to test your endstops with M119 command, be sure that all shows open when not hit by a carriage and triggered when you press them with your fingers.