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: Had I not heard this from the Messenger of Allah (peace and blessings be upon him) (I would have kept my oath), 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."
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.