Often you can simply put some (schottky) diodes in series in the step and direction signals in between both "step generators" and the stepper motor drivers, but it depends on the actual hardware you have.
Another option that can work is to put some 74HC series logic in between and use that to switch signals. For example with a 74HC541 you can switch 8 digital signals on/off via the "G" inputs. You can then use a simple double throw switch to switch the "G" inputs of the TTL IC's.
In a more elaborate setup, you can control the "G" inputs with some microcontroller and you can make it as complex as you want or need.