A method for operating an infusion device (1) for administering a medical fluid to a patient (P) comprises: pumping, using a pumping mechanism (11), a fluid in a downstream direction through a delivery line (3) measuring, using a sensor device (14), a measurement value indicative of a pressure in the delivery line (3) in order to be able detect, from a rise of the pressure beyond a predefined pressure threshold, the presence of an occlusion in the delivery line (3) and, in case of an occlusion, reversing the pumping mechanism (11) to pump fluid in an upstream direction opposite the downstream direction for reducing the pressure in the delivery line (3). Herein, for stopping the reverse pumping of the fluid in the upstream direction at least two criteria are applied and the reverse pumping is stopped if at least one of the at least two criteria is fulfilled, wherein as a first criteria it is determined whether the pressure in the delivery line (3) has fallen below a predetermined residual pressure threshold, and as a second criteria it is determined whether the volume pumped in the upstream direction during the reverse pumping action of the pumping mechanism (11) has reached a predetermined volume computed based on the predefined pressure threshold used for the occlusion detection. In this way a method for operating an infusion device for administering a medical fluid to a patient is provided which allows for a precise and reliable stopping of a reverse pumping in order to obtain a desired reduction in pressure in the delivery line in case of an occlusion.