[1.7.x] Fixed #22248 -- Made RenameModel reversible

Backport of cf7a2a000e from master