The electromigration process has the potential capability to move atoms one by one when properly controlled. It is therefore an appealing tool to tune the cross section of monoatomic compounds with ultimate resolution or, in the case of polyatomic compounds, to change the stoichiometry with the same atomic precision. We demonstrate that a combination of electromigration and antielectromigration can be used to reversibly displace atoms with a high degree of control. This enables a fine adjustment of the superconducting properties of Al weak links, whereas in Nb the diffusion of atoms leads to a more irreversible process. In a superconductor with a complex unit cell (La2−xCexCuO4), the electromigration process acts selectively on the oxygen atoms with no apparent modification of the structure. This allows us to adjust the doping of this compound and switch from a superconducting behaviour to an insulating state in a nearly reversible fashion. We discuss the conditions needed to replace feedback controlled electromigration by a simpler technique of electropulsing. These findings have a direct practical application as a method to explore the dependence of the characteristic parameters on the exact oxygen content and pave the way towards a reversible control of local properties of nanowires.