The magnetic quantum number is not related to a fixed external coordinate system. In atoms this number shows the relation between electrons in the same orbital. (Preferable seems to say shell because nothing is orbiting as we know now.)
More in detail, it was find out that maximum two electrons respectively 8 electrons can occupy the three first shells of an atom. The electron has a magnetic dipole moment and due to this for every electron of a shell oriented in one direction exists an electrons with orientation of it's magnetic dipole moment in the opposite direction (Pauli's rule).
With an external magnetic field you get an influence on the orientation of the atoms constituents but after switching of the field you will get the starting orientation of the constituents to each other again.