Fix legend when revert called - #790