Input Rerouting using IC or Transistor Application
You would need some kind of arrangement with an analog switch (cd4066).

The 4066 consists of 4 switches that each have two inputs, one output, and a control input.  The control input selects which input is connected to the output.

The switches are also bidirectional - you can use them to switch one of two inputs to the output or one input to one of two outputs.

Don't let the name bother you.  It will switch digital signals just as well.

There are other analog switch ICs as well.  Some with more switches er chip, some with less.  There are switches with more inputs more control signals as well.

Analog switches may also be called multiplexers.