The only way to give your elf magic back is to bring them back to life. This can be done by using the exact same spell that originally gave them their magic, and then channeling that same energy into the elf's body. However, this is a very delicate process and should only be attempted by a trained spellcaster or wizard.