Which Version ogf Allegro are you using?? It is always helpfull if you give complete information.
If your version is below 15.2 then you have 1 undo and that is before you exit the command if you have exited the command you have no undo.
So , before exiting command simply rigth click and select oops or F3 for undo.
In 15.2 you have unlimited undo and is in tool bar indicated as reverse arrows.
u have no undo option in allegro, but u hve oops command
which will undo your previous operation, before finish the current command
Once you come out of any command, no undo is possible