Reverting changes to scene made by timeline during runtime

When playing a timeline using a Playable Director, and setting Wrap Mode to “none”, I expect that after the timeline is done playing, the scene will revert back to its state before the timeline started playing (undoing all the changes the timeline has made).
In reality, the scene is left in the state of the last frame of the timeline.

Is that the expected behaviour? Is there a way (maybe through scripting?) to revert the changes of the timeline after it is done playing?

No, that isn’t the expected behaviour. Any changes made by timeline remain, except in certain cases - for example Activation Tracks have an option for what happens when the timeline stops.