How to set layers to default

In my diagrams, I am displaying different types of diagrams depending on selection from drop down OR tree view.
In such case I am not initializing the various templates again and again.
So same diagram object is used for various diagram ( by changing the layouts , adding various templates in required collections)
While initializing , depending on diagram type , I am also adding layers.
Now when initlializing code exected, it gives me “Layer with same name already exists” message.

How one can clear all user defined added layers and set it to default ??

GoJS Layers -- Northwoods Software Basically, only the “Background”, “”, and “Foreground” layers exist by default. I suppose you can delete the “Background” and “Foreground” layers if you don’t want to use them and you only want to use your own.