I'm not sure if it has already been implemented in an editor, but as a user of E-texteditor (not liking it anymore, so I bought Sublime), I can say they have plans implementing selective undo/redo...
But not only that is an argument to support this feature, also I'd like to encourage the implementation, because it comes really handy. Imagine this:
You've created some code. Some hours later you continue at some other point in the code, but then you find out your work a few hours ago is rubbish and you want to undo some changes made to it.
Even though it might be a cool feature, it could also be a potential problem to your document... It could get corrupted or get all messy. So it would require an extensive logging of every change, and that could require some slow-downs or disk-space?