How do I get the number and status of undo

How do I get the number and status of undo or redo when I use paint to edit segmentation