Whats the car/year?.......as what you need to do depends on what sort of diesel engine you have.
As a basic rule of thumb, if you have a newish car with an electronically controlled high pressure injection system then drain the tank and get as much of the petrol out as possible, because there's a high possibility it will damage the fuel system and injectors.
If, however, it's an older style low pressure mechanical injection system, found on cars up to 7 or 8 years old, then it'll be fine to just leave it in and top the tank off with fresh diesel; all the petrol will do is act as injector cleaner.
Older diesels will run on virtually anything liquid that burns- veggie oil, old engine oil, melted lard, you name it, but new HDi, HPi, etc, types have extremely complex control systems and do NOT like petrol!