In JavaScript, when you declare a global variable it is actually a property of the "global" object (usually the DOMWindow, or "window"), so you can simply delete the property by the name of the variable to delete the global reference. For example:
var foo = 123;
alert(foo); // Alerts "123"
alert(window.foo); // Alerts "123"
delete window.foo;
foo; // ReferenceError: foo is not defined.
So if you can keep track of the global variables you use (which should be very, very few, like one) you can just delete it as a property from the "window" or "global" root-level objects.
Update
You can extend this idea to work generally as follows. At the beginning of your script, enumerate the properties of the global object and store them in a reference object. Then, when you want to identify newly added globals, enumerate the global properties again and store only the ones which do not exist in the reference object (meaning they were newly added since you last checked). Then simply delete these additional properties.