Unscrew the bottom sensor and "some" diesel will come out. Then unscrew the filter, which will still have some in it too (just tip it out). I use an old plastic bin, but you'll only lose a litre or so.
Then, before screwing the new filter in, just pour some diesel in the top from a fuel can...