pymel.core.system.flushUndo

flushUndo(*args, **kwargs)

Removes everything from the undo queue, freeing up memory.

Derived from mel command maya.cmds.flushUndo

Example:

import pymel.core as pm

pm.flushUndo()