Does Command Undead last past an undead’s death and raising?

If an undead creature fails its save against the Necromancy wizard feature Command Undead, and then dies and is raised or rejuvenated (eg a lich coming back from their phylactery) are they still affected by Command Undead? If so, do they have to still be undead (eg could Command Undead followed by killing them and casting a high-level resurrection spell give you control of a living creature)?