Electron-doped and hole-doped superconducting cuprates exhibit a symmetric phase diagram as a function of doping. This symmetry is however only approximate. Indeed, electron-doped cuprates become superconductors only after a specific annealing process: This annealing affects the oxygen content only by a tiny amount, but has a dramatic impact on the electronic properties of the sample. Here, we report the occurrence of superconductivity in oxygen-deficient Nd$_{2-x}$Ce$_x$CuO$_4$ thin films grown in oxygen-free environment, after annealing in pure argon flow. As verified by x-ray diffraction, annealing induces an increase of the interlayer distance between CuO$_2$ planes in the crystal structure. Since this distance is correlated to the concentration of oxygens in apical positions, and since oxygen content cannot substantially increase during annealing, our experiments indicate that the superconducting phase transition has to be ascribed to a migration of oxygen ions to apical positions during annealing. Moreover, as we confirm via first-principles density functional theory calculations, the changes in the structural and transport properties of the films can be theoretically described by a specific redistribution of the existing oxygens ions at apical positions with respect to CuO$_2$ planes, which remodulates the electronic band structure and suppresses the antiferromagnetic order, allowing the emergence of hole superconductivity.