Localised undo

How to undo redo only in a particular parts without affecting changes in the project?
Is it a preference somewhere? I’d like the option.

if I understand you correctly look at Edit -> history

there you can see a list of what you have done before