In order to remove a slice, you need to have a handle to it.
One possible method is to have a global variable that you use to store the last placed handle
Code: global variable(73, last sl)
And then when you place the sprite slice, you store the handle
Code: sl := load large enemy sprite(a)
last sl := sl
So later when you press the undo button, you can remove the slice using that saved handle
Code: free slice(last sl)
The problem with this method is that it only works for the most recently placed slice, so you only get one level of undo. If you want to allow more levels of undoing, you can use a different approach.
Each time you add a new slice, it gets added as a child to the "sprite layer" (which is a container slice the same size as the screen)
You can get a handle to the most recently added slice like this:
Code: variable(recent sl)
recent sl := last child(sprite layer)
free slice(recent sl)
This will work for all the slices parented to the sprite layer, so you will have unlimited levels of undo.