Agreed this would be a useful function. I just installed Thunderbird last night and configured multiple accounts into a unified inbox. I accidentally swiped and deleted an email and looked for an undo button. Since there was none I had to go into each account's trash folder and try to find which email was deleted. Gmail and Outlook both have this option.
I can't agree more! This is one of the main features I miss coming from FairEmail which has this as well.
I admit I'm somewhat of a "lazy swiper" and you wouldn't think how often I accidently delete or archive a mail when just trying to pull down to refresh my inbox. And than I'd exactly as OP says - I've to go through all my mail accounts trying to find which mail I just deleted. And if it is an older mail that is nearly impossible because it isn't even at the top of my trash folder but could be everywhere.
Thunderbird desktop has Ctrl+Z undo and always has, perhaps you have the Android version in mind where you have no keyboard and some transient feature would be useful. I don't use it, so I have no idea if the k-9 rebadged product has Ctrl+Z for undo.