What exactly do you mean by "reset the loop". Do you mean make it go back to the beginning? or do you mean break out of the loop to the next part of the code?
If you are looking for a way to break out of the loop, then simply issue a "break;" command. If you want to reset the loop back to the initial status, then whatever variable you are testing, just set it back to it's initial value when entering the loop.