You can sell the item by clicking on the 'Sell' option. You can also cancel selling by clicking on the 'Cancel' option that appears after selling the item. There is no time limit for this option.
❗However, it will disappear when you click on another item or in-game icon.

If another item has taken the spot of sold item (ex: anemone seed, butterfly, XPs), then click on 'Cancel', and the item will return to the queue in between the 'Inventory' and 'Shop' icons:

🎯Be careful while selling generators & higher-level items.
🎯Use the 'Cancel' option to undo the selling.
🎯Check the queue in case there is no space on the board.