Many people misunderstand Excommunication and believe that it is permanent.
Like this paragraph hints, the excommunicant can be recommunicated.
Excommunication is a form of correction of the faithful that have been persistent in a grave sin and have resisted other forms of correction.
Excommunication severs the member of the congregation from the body of the Church. They are denied the sacraments. And other members are expected to ostracize the excommunicated member.
However, the excommunicant can be readmitted to the body of the Church if he repents and confesses his sin.
Do not be mistaken in the belief that this is not a sever punishment. If the excommunicated does not reform his ways repent and be readmitted to the Church, he faces eternal damnation. Those who advocate the death penalty are mistaken if they believe that it is the worst that can happen to them. Eternal Damnation is far worse.
Then what?