Consider the following (thought) experiment, where an electron is emitted, then deflected by a magnetic field, and then detected:
Because the momentum of the electron changes when it gets deflected, it seems intuitively clear that there should be a reaction force on the magnet, which could in principle be detected.
But now consider the following modified setup:
Here electrons are emitted, with their spin aligned in some arbitrary direction. The first Stern-Gerlach magnet, A, can deflect electrons either up or down. B and C deflect the paths of the two beams, and the final magnet, D, combines them back into a single beam, effectively reversing the action of A. This system of magnets is followed by a detector, which can measure the spin of the electron in the $z$ direction, perpendicular to the plane of the rest of the diagram.
According to my understanding of quantum mechanics, the measurements from this detector should be the same as if the magnets were not there. That is, if the electrons are emitted with their spins always pointing in the $z$ direction, the detector should also find that their spins are always 'up' in the $z$ direction.
The problem is that if we can measure the reaction force on any of the four deflecting magnets then we can work out which of the two paths the electron took, and thus we would have measured its spin in two directions simultaneously. Clearly this isn't possible, so where have I gone wrong? Is there a reaction force on the magnets? If there isn't, what happened to the conservation of momentum? Is it just that the reaction force does exist but we can't measure it? (And if so, what prevents us from doing so?) Or have I just made a mistake in reasoning about how this setup would behave?