Serisouly drain the tank, refill with fresh diesel, then run it a while, then change fuel filters.
I will admit I have done this once. 5am on my way to the hunting stand. Stopped jumped out of the truck. Paid at the pump. Next thing I know I was smelling gasoline very strong. I stopped looked and notice I put about 4 gallons in my tank. I just put the nozzle back, repay then fill the tank with 26 gallons of diesel. I have 167,772 miles on my truck with no problems.
Some people will even claim that you should run 1-2 gallons of gasoline through your engine to clean the injectors. I won't do it on a regular basis. They have companies that make injector cleaning additives for fuel for a reason.