Narrated In a narration which is Marfu' (attributed to the Prophet) reported by Abu Dawud and an-Nasa'i from Abu Hurairah (RA) it has:
"Do not swear by your fathers, nor by your mothers, nor by the rivals (set up as equals with Allah); and do not swear by Allah except when you are speaking the truth."
عَنْ اِبْنِ عُمَرَ رَضِيَ اَللَّهُ عَنْهُمَا, { عَنْ رَسُولِ اَللَّهِ - صلى الله عليه وسلم -أَنَّهُ أَدْرَكَ عُمَرَ بْنَ اَلْخَطَّابِ فِي رَكْبٍ, وَعُمَرَ يَحْلِفُ بِأَبِيهِ, فَنَادَاهُمْ رَسُولُ اَللَّهِ - صلى الله عليه وسلم -
"أَلَا إِنَّ اَللَّهَ يَنْهَاكُمْ أَنْ تَحْلِفُوا بِآبَائِكُمْ, فَمَنْ كَانَ حَالِفاً فَلْيَحْلِفْ بِاَللَّهِ, أَوْ لِيَصْمُتْ" } مُتَّفَقٌ عَلَيْهِ 1 .1 - صحيح. رواه البخاري ( 6646 )، ومسلم ( 1646 ) ( 3 ).
Narrated Narrated Ibn 'Umar (RA):
Allah's Messenger (ﷺ) overtook 'Umar bin al-Khattab when he was with a party of riders of about ten and 'Umar was swearing by his father. Allah's Messenger (ﷺ) called them and said, "Verily! Allah forbids you from swearing by your fathers. Therefore, if anyone swears, he must swear by Allah or keep silent."
Allah's Messenger (ﷺ) said: "When you swear an oath and then consider something else to be better than it, make atonement for your oath and do the thing that is better." . A wording of al-Bukhari has: "Do the thing that is better and make atonement for your oath."
In a narration by Abu Dawud: "Make atonement for your oath, then do the thing that is better." .