As Farlander said use a global variable. Call it restarts or whatever you want.
You'll then need to save/load the variable every time the layout changes. You could do something like this:
Sorry for the image layout I did it on my phone not PC.
You can then check to see if the variable is saving by using the debug feature. It lists all variables, sprite positions etc. Very handy!