When a man declares his wife unlawful for himself that is an oath which must be atoned, and he said: There is in the Messenger of Allah (ﷺ) a noble pattern for you.
Sahih Muslim Book 18, Hadith 26