To manually orient a joint’s local axes
The current joint’s local rotation axes appear.
in the Status line (toolbar) to turn on the Select by component type mode, then
Select Miscellaneous components icon and turn on Local Rotation Axes. You can now select the local rotation axis of your joint.

rotate -r -os 180 0 0;
This command rotates the current joint’s local axes 180 degrees about its X-axis.