I asked Imam (as) about two men who married two women, but each man was mistakenly given the wife of the other.
Imam (as) said: "Each woman must observe the waiting period (iddah) from the other man, and then they may return to their rightful husbands."