In any event, if you did the priest would set you straight in Confession. The most common automatic excommunications (for example for abortion) can usually be lifted by the priest in the confessional.
In other cases he will guide you as to what needs doing to lift the excommunication. By my understanding it’s nothing onerous or timeconsuming, and you won’t need to confess again to anyone else or anything.