Using latest 2017.3.2.
This bug https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000478370-Undo-Z-behavior-changed-or-a-bug-
Basically the Control-Z Undo feature:
If the cursor is *not* where the last operation was done (eg user moved the caret after), then the caret is moved there, first. No actual Undo is performed.
Sometimes, even if the cursor is away from the last change, ^Z goes there and performs the Undo
Doing some work around line 50, which has a syntax error. Doing undo does remove normally the line. Doing Undo again goes to line 80 and undo what was done at line 80 (should just go to line 80 without undoing anything yet).