I'd use 90+% isopropanol from the drug store or hardware store, not gasoline. The isoprop will pull the water out faster and evaporate with less danger of explosion--and leave no residuals in the diesel tank.
If you already have the contaminated diesel out, the best way to "polish" it is to let it stand in a tall narrow container, like a "yard of ale" glass or a stick of 2"-3" PVC pipe sealed on the bottom end. The water will separate out all by itself after a couple of days, then you can just pour off the diesel and throw out the "water". Or put a petcock on the bottom, drain off the crud until just diesel is coming out. The narrower the container, the easier to see the separation. But even in the jerry cans, it will separate.
You can let it sit for a few days, pour off the top half (which almost certainly is all diesel), combine the remaining halves, let it sit again, and do it repeatedly that way too. Just a matter of time and patience versus money.
Throw in a can of diesel "drier" or booster or whatever magic the local auto shop sells, when you put the good diesel back in the tank. Just in case.
On the bright side...you didn't run it into the engine, and I'll bet you never leave THAT cover off again. :-)