Using a switch to "unplug" Arduino Uno

Then you need a double pole switch to disconnect the MIDI circuits from the TX & RX connectors during upload of code.
This is what I used here :-
MIDI Shield