If you connect nodes into a merge node (for example) wrong way and you need to switch foreground and background inputs you can do it by selecting the merge node and hitting CTRL+T
MAC OS 10.12.6 IMac 5K 27 inch (2017) Processor 4.2 GHz Intel Core i7 Memory 32 GB 2133 MHz DDR4 Start up Disk MAC HD Graphics Radeon Pro 580 8192 MB Storage MAC 2.12TB Fusion External 3TB USB disk