You can change the path that a wire takes to the block to which it is currently connected. And you can also rewire a block so that it is connected to a different block or to a different port of the same block.
Wires cannot create cycles. See
Wire restrictions for detailed information.
This automatically selects the blocks to which the wire is currently attached so that you can see the port names.
Or to move the wire to a different port, drag the move icon (
) that is now shown at the input or output port (a hand pointer is shown in this case) to a different port.