You can use a CD74HCT126 or 125 or SN74HCT126 or 125 to do the switching.
You will need 3 control signals, two for the 125/126 part and one for the RS485 driver.
You can also disconnect everything using this set-up so you can download code to the Arduino.