Transfer the accidentals from the beginning of the line to the interval.
Depending in which key the piece is written from which you want to analyse an interval there are different accidentials at the beginning of the piece. Take those accidentials and move them directly in front of the interval.