The diagram is confusing—I’m a bit unclear what it is. The equation you wrote suggests that it’s supposed to be an R-L series circuit, consisting of a resistor whose resistance is R, in series with an inductor that has an inductance of L and a resistance of r, in series with a switch K and a battery E.
If my understanding of the circuit is correct, then the differential equation for the current is determined by applying Kirchoff’s Voltage Law around this series circuit. The most general statement of Kirchoff’s Voltage Law must account for the voltage drops across not only the resistor and the inductor, but also across the switch and the battery. Your differential equation states that the sum of the voltage drops across the resistor and the inductor is zero. That happens to be true for t>0—but only for t>0—because for t>0 the current is zero, and the entire voltage of the battery appears across the open switch such that their sum equals zero.
Try this: Compare your differential equation for the current for t>0 to the differential equation for the current for t<0 (i.e., before the switch is opened).