A woman embraced Islam during the time of the Messenger of Allah ﷺ; she then married. Her (former) husband then came to the Prophet ﷺ and said: Messenger of Allah, I have already embraced Islam, and she had the knowledge about my Islam. The Messenger of Allah ﷺ took her away from her latter husband and restored her to her former husband. (Using translation from Abū Dāʾūd 2239)
أَسْلَمَتِ امْرَأَةٌ عَلَى عَهْدِ رَسُولِ اللهِ ﷺ فَتَزَوَّجَتْ فَجَاءَ زَوْجُهَا الْأَوَّلُ إِلَى النَّبِيِّ ﷺ فَقَالَ يَا رَسُولَ اللهِ إِنِّي قَدْ أَسْلَمْتُ وَعَلِمَتَ إِسْلَامِي فَنَزَعَهَا النَّبِيُّ ﷺ مِنْ زَوْجِهَا الْآخِرِ وَرَدَّهَا عَلَى زَوْجِهَا الْأَوَّلِ