Heat management at the nanoscale is nowadays one of the leading research topics in many different scientific areas, including refrigeration and thermometry, coherent caloritronics, thermoelectric energy conversion and information processing. The overheating of microprocessors components is currently the most limiting factor in the development of information technology, which motivates the concern in finding alternative ways to control and evacuate heat in such devices. Theoretical work led to the possibility to control the heat current and device heat diodes and transistors. The presence of a magnetic field allows for the simultaneous presence of reversible and irreversible heat currents. In a generic multi-terminal setup, we can split the heat current flowing from a reservoir to the system, into the sum of a reversible and an irreversible part: while the reversible component changes sign by reversing the magnetic field B, the irreversible component is invariant under inversion B→-B. In this work we use the reversible components of the heat currents to propose a magnetic thermal switch: a boolean setup which allows to control the heat flow by making use of an external magnetic field as a selector of the working configuration. For a generic three-terminal device operating in the linear response regime, we show that by properly tuning the voltage biases we can achieve a broad spectrum of possible operating conditions: each of these can be defined in terms of the heat currents flowing through the system, thus relying on its thermal properties only. This concept can be extended in order to design a programmable device for the management of heat flows in a generic three-terminal setup, allowing switching on/off, inversion and partition of the heat currents in different reservoir with a complete controllability. The magnetic field acts as a knob selecting one of the possible working conditions of the device, without needing to modify the reservoirs parameters (temperatures and electrochemical potentials) when switching from one working condition to another. A significant advantage of our approach is the absence of any temperature constraints: as far as the system operates in linear response, our results hold, regardless of the particular dynamics in the system.