Abdullah bin Amr narrated a hadith during the Battle of Jamajim, saying: A man asked Sayyiduna Adi bin Hatim (may Allah be pleased with him) for help, so he swore that he would not give him anything. Then he said: I wish I had not heard from the Messenger of Allah (peace and blessings be upon him), he (peace be upon him) was saying: "If a person swears an oath about something, then sees something else as better, he should do what is better and then offer expiation for his oath."
Hadith Referenceسنن دارمي / من النذور و الايمان / 2382
Hadith Takhrijیہ حدیث صحیح ہے۔ دیکھئے: [مسلم 1651] ، [نسائي 3794] ، [ابن حبان 4346] ، [بخاري فى الكبير 151/5]
Brief Explanation
(Commentary on Hadith 2381)
That is, he swore an oath saying: "By Allah! I will not help this person," then later thought that helping is better, so he should help that man first, meaning he should break the oath, and then offer expiation (kaffarah) for that oath.
That is, first break the oath, then give the expiation.