Is there a way to set the x direction in marlin from gcode?

Is there a way to set the x direction in marlin from gcode?

I have swapped the motor to the opposite side of the belt and its effectively turning backwards.

The machine is printing beautifully and I don’t want to reflash.

You could just rotate the motorconnector.

What is interpreting the gcode? For me I use grbl and it has options to invert the axis

1+ for changing the motor connector.

If it is not easy to just turn the connector around, swap the wires on pin 1 and 2. (Or 3 4 - your choice)

Look for invert x axis in configuration.h