If you have accidentally put diesel in a gas tank, it's natural to panic. Most people would be horrified, thinking they have done something majorly wrong. True enough, this is bad but nowhere near as bad as it could be. Now, if you had put gas into your diesel car, then you would have a reason to get upset. It sounds odd to accidentally put diesel into your gas car, the diesel fuel nozzle at a gasoline pump is not designed to fit into an unleaded gas tank. However, people do store gasoline in jerry cans and sometimes don't label them or mislabel them, making this a more plausible mix-up.
If you know that you have accidentally put the wrong fuel in the car, then don't compound the mistake by driving the vehicle while trying to think about what to do. Instead, call your mechanic immediately. At this point, the damage isn't permanent. If you drive and continue to drive, at one point the vehicle will stop and you will still have to have it towed.
There are two things you can do to try to fix the damage: