It was narrated from Ibn 'Abbas that: a woman came to the Prophet and became Muslim, and a man married her. Then her first husband came and said: "O Messenger of Allah, I became Muslim with her, and she knew that I was Muslim". So the Messenger of Allah took her away from her second husband and returned her to her first husband.
The lesson here is that we should always respect people’s rights regardless of their religion or beliefs, as this is what Allah has commanded us in His book - The Quran - “And do not wrong one another” [ 4:129 ]. We must also remember that no matter how much time passes or how much our circumstances change, our commitments remain valid until they are fulfilled or annulled according to Islamic law.