Context. The rotation periods of young low-mass stars after disks have dissipated (less than or similar to 10 Myr) but before magnetized winds have removed significant angular momentum is an important launch point for gyrochronology and models of stellar rotational evolution; the rotation of these stars also regulates the magnetic activity and the intensity of high-energy emission that a ffects any close-in planets. A recent analysis of young M dwarf stars suggests a distribution of specific angular momentum (SAM) that is mass-independent, but the physical basis of this observation is unclear. Aims. We investigate the influence of an accretion disk on the angular momentum (AM) evolution of young M dwarfs, whose parameters govern the AM distribution after the disk phase, and whether this leads to a mass-independent distribution of SAM. Methods. We used a combination of protostellar spin and implicit hydrodynamic disk evolution models to model the innermost disk ( similar to 0:01AU), including a self-consistent calculation of the accretion rate onto the star, non-Keplerian disk rotation, and the influence of stellar magnetic torques over the entire disk lifetime. We executed and analyzed over 500 long-term simulations of the combined stellar and disk evolution. Results. We find that above an initial rate of. M-crit similar to 10 8 M-circle dot yr(-1), accretion "erases" the initial SAM of M dwarfs during the disk lifetime, and stellar rotation converges to values of SAM that are largely independent of initial conditions. For stellar masses >0:3 M-circle dot, we find that observed initial accretion rates. M init are comparable to or exceed. M crit. Furthermore, stellar SAM after the disk phase scales with the stellar magnetic field strength as a power law with an exponent of 1:1. For lower stellar masses,. M init is predicted to be smaller than. M crit and the initial conditions are imprinted in the stellar SAM after the disk phase. Conclusions. To explain the observed mass-independent distribution of SAM, the stellar magnetic field strength has to range between 20G and 500G (700G and 1500 G) for a 0.1 M-circle dot (0.6 M-circle dot) star. These values match observed large-scale magnetic field measurements of young M dwarfs and the positive relation between stellar mass and magnetic field strength agrees with a theoretically motivated scaling relation. The scaling law between stellar SAM, mass, and the magnetic field strength is consistent for young stars, where these parameters are constrained by observations. Due to the very limited number of available data, we advocate for e fforts to obtain more such measurements. Our results provide new constraints on the relation between stellar mass and magnetic field strength and they can be used as initial conditions for future stellar spin models, starting after the disk phase.