Order 23 Rule 1 to 4, CPC deals with such situation; A plaintiff can withdraw a suit as a matter of right without the permission of the court. In such a case he shall be precluded from suing again on the same cause of action. He cannot withdraw a suit reserving to himself such a right to bring a fresh suit. Even if the plaintiff fails to make out his case on the merits of the application for withdrawal, if, in law, the plaintiff is entitled to withdraw, the plaintiff cannot be prevented from making such an application. A suit can be withdrawn in part with liberty to sue again in respect of it. But the whole suit cannot be withdrawn with liberty to sue again in respect of part only. When only part of suit is withdrawn, the remaining part must be proceeded with and if not, it must be dismissed.
Thus, once a suit is withdrawn by the plaintiff, it automatically follows that whatever benefits that were initially gained by the plaintiff by way of interim orders of the court, would naturally vanish and cease to exist. Except 1) to pay such costs as the court may award; and 2) plaintiff is precluded from instituting any fresh suit in respect of that subject-matter under Rule 1(3),
the right of the plaintiff to withdraw from a suit is absolute and unqualified.