Is it possible to select again the last selected items? If I click unwillingly and lost the selected items, is it possible to select them again without having to manually click on each one of them (which sometimes takes a little while)? Thanks a lot for your help
If there is a way to accomplish the behavior you want, I am not aware of it. As temporary workarounds, you might look into using Selection sets or moving selection to a new layer. The current Undo feature only remembers previous actions, not selections. Note this related answer which shows the behavior is useful when selecting multiple layered objects.
You could also submit a feature request for this in the Gitlab Bug Tracker for Inkscape, as officially recommended. I can see that being relatively simple to implement and being useful to a lot of people. To me, the feature would be a separate Undo select action just for selections, probably not mapped to any hotkeys by default but just available in the Edit menu. Obviously it would have to reset after actions which change what can be selected, e.g. deleting objects and grouping/ungrouping, but this would still be a useful feature.