This Minecraft mod that takes the Wandering Trader concept from one of SimplySarc's suggestion videos and implements it.
Whenever a player dropped item despawns/gets destroyed, the stacks get internally added to a list and have a chance to show up next time when trading with a Wandering Trader.
Of course, you can legitimately trade your items back only once (we don't talk about villager trade glitches ^^)