الجواب وبالله التوفيق
As per the situation described in your question if the underwear was worn for one full day and night, one dum will become wajib. If it was worn for a period less than that then sadaqah will become wajib. This sadaqah will be equal to the amount due for sadaqatul-fitr i.e. if one pays by the measure of wheat then the quantity or equivalent cost of half Sa‘ (3.75 lbs.) of wheat shall be paid.
If wearing the underwear is due to some uzr(legitimate issue) then it is your choice to pay the kaffarah either by performing dum, paying sadaqah or fasting for three days.
واللہ اعلم بالصواب