It's not a function you can add (not easily, would be very complicated) if it is not already built in.
If it's built in but not wired up, then that's what I wrote up the very basic instructions to find out.
But to add the function if it is not there could be done a few ways.
If it has a self-learn function, some of those will switch direction of the motor each time you run it once it has found the right combination. But they usually require you get the wheel off-ground to do the learn, which may not be practical in all situations. You'd then re-run the learn after you've backed up enough, to go forward again. If you're zigzagging to get into/out of a parking spot or some other situation, it would be impractical at best. (lift drive wheel(s), run learn, put back on ground, go the distance needed in taht direction, lift drive wheel(s), run learn, put back on ground, etc etc, repeat until done).
Assuming the MCU in the controller is reprogrammable (not all are) and you know how to write motor controller firmware (from scratch, essentially, since you can't typically download the existing firmware to just alter it), you could do that and have it do anything it's hardware could do. There are actually some threads about doing this as OSF(W) open source firwmare on a number of controllers and displays, with completed firmware of several versions.
To do it in hardware you'd have to setup relays to switch the halls and phases from the forward combination to hte reverse one. It doesn't have to switch the actual phase wires, just the gate signals from the MCU to the FETs, so it doesn't require high-current relays. First you'd determine the phase/hall order for reverse (since you already know what works forward), and then wire the relays so they switch from the forward to the reverse wiring pattern when engaged, and leave themselves in forward when not. Then wire a switch to engage all the relay coils (powered from perhaps a DC-DC from your battery, as the controller may not have enough power on it's own 5v/etc lines to run the relays). For cost it's cheaper to use six DPDT (2P2T) relays than a single one that switches everything at once (12P2T).
It's simpler to replace the controller with one that already has all the functions you need built in, and probably cheaper, too.