When you delete files in Finder, including the Desktop folder, you right-click the unwanted item and choose Move to Trash, then you can recover them with the Put Back option. However, if you directly delete the items by dragging them to the Mac Trash, and want to redo the option, you will find the Put Back option is not available. You just need to directly drag-drop the items from Mac Trash to the desired location on your Mac.
Finder saves the original location in metadata when you Move something to the Trash. To enable "Put Back," it makes use of that metadata. But Finder is unaware of the origin of a move you make to the trash from another program.