Undo makes multiple steps back

When I paint foliage on my level, one undo function makes it revert to multiple (many) steps back. It started to be like this today. Why can it be?