كتاب المقدمات
The Book of Miscellany
(6)
Chapter: Piety
(6)
- باب التقوى
Riyad as-Salihin 72
'Adi bin Hatim At-Ta'i (May Allah be pleased with him) said:
I heard the Messenger of Allah (ﷺ) say: "He who has taken an oath (to do something) but found something else better than that (which brings him closer to Allah), then he should do that which is better in piety (and he should expiate for the breaking of oath)".

[Muslim].

الرابع‏:‏ عن أبي ظريف عدي بن حاتم الطائي رضي الله عنه قال‏:‏ سمعت رسول الله صلى الله عليه وسلم يقول‏:‏ ‏ "‏من حلف على يمين ثم رأى أتقى لله منها فليأت التقوى‏"‏ ‏(‏‏(‏رواه مسلم‏)‏‏)‏‏.‏
Reference : Riyad as-Salihin 72
In-book reference : Introduction, Hadith 72