It would be really awesome if adobe can implement 'Layer focused Undo' or Undoing for only selected objects. (it could be a smart object or a shape)
for tools like Photoshop and Illustrator. or at-least in Adobe XD.
Feel free to post a Feature Request over at
Photoshop Family Customer Community
but you may want to go a little more into detail about what you actually mean.
I'm coming from a time, where UNDO in Ps was limited to one level and there were no layers... ;-) And I survived.
Depending on what you want to do, you can to a limited extent if you use the history panel and history brush together. Undo/redo and history in Adobe Photoshop
Retrieving data ...