execute if score global undoStackHead matches 1 run function bd:game/perform_undo/1
execute if score global undoStackHead matches 2 run function bd:game/perform_undo/2
execute if score global undoStackHead matches 3 run function bd:game/perform_undo/3
execute if score global undoStackHead matches 4 run function bd:game/perform_undo/4
execute if score global undoStackHead matches 5 run function bd:game/perform_undo/5
execute if score global undoStackHead matches 6 run function bd:game/perform_undo/6
execute if score global undoStackHead matches 7 run function bd:game/perform_undo/7
execute if score global undoStackHead matches 8 run function bd:game/perform_undo/8
execute if score global undoStackHead matches 9 run function bd:game/perform_undo/9
execute if score global undoStackHead matches 10 run function bd:game/perform_undo/10