It happens quite often that I want to undo changes locally or line-wise. For example, when I change multiple lines in a source code and I want to revert only one of them, then I have to step through the entire undo tree to find the state I want to return to. It would be better if I could only revert the marked region or the line where the point is. Is there something like this already in existence?
This is standard Emacs functionality (since 1998 / 20.3).
Assuming you have transient mark mode enabled, just mark the region, and use undo as normal, and Emacs will perform undo operations relevant to the (active) region only.
With transient mark mode off, or if the marked region is not active, use a C-u prefix argument to the undo command.
or "selective undo" in the manual: C-hig