This is an action at law. Plaintiff declared in general assumpsit and filed specifications of its claim reading in part as follows:
"December 31, 1956 — Balance due covering the Victory, Vermont, project (Construction of Facilities, North Concord, Vermont — Bid Serial No. ENG-19-016-55-5) $1790.25 with legal interest from the 31st day of December, A. D. 1956, to date of judgment.”
*163The defendant filed an answer denying liability, and further pleading that on the 31st day of December 1956 the plaintiff for valuable consideration released the defendant of all claims. Thereupon the plaintiff filed a replication to defendant’s answer in substance, (1) denying that it, for valuable consideration, released the defendant from the claim set forth in its specifications; (2) denying that it released the defendant from its obligation to pay the sum of $1790.25; (3) alleging that the defendant failed to set forth the consideration upon which the release was made; and (4) further that if the defendant has a release from the plaintiff said release was obtained by * * * "fraud, misrepresentation, mistake, and without the consent of the plaintiff * * *.” The defendant then filed a demurrer to plaintiff’s replication substantially stating, (a) that the plaintiff had failed adequately to plead that the release was obtained by fraud, misrepresentation, mistake, and without the consent of the plaintiff; (b) that plaintiff had failed to allege that the consideration received for said release had been tendered or returned to the defendant; and (c) that the grounds of plaintiff’s replication, if valid in fact, must be by complaint in equity and may not be pleaded at law. Upon hearing defendant’s demurrer to plaintiff’s replication was sustained, and upon leave given by the court plaintiff filed an amendment to paragraph four of its replication.
Plaintiff’s amendment, relating to the alleged fraud, is summarized as follows: On December 31, 1956 the plaintiff executed a sub-contractor’s release in favor of the Joseph A. Bass Company stating the consideration to be the sum of $424,873.60 of which $382,484.83 had been paid by the defendant and that the defendant was to pay the sum of $42,-388.77 to the plaintiff on the above date. Only $29,516.52' was paid. It is alleged that the item of $1790.25 (for which plaintiff seeks to recover) was left out of the consideration for the release because the defendant stated to the plaintiff that it "should recover” or "collect” the sum of $1790.25 from the Cass-Warner-Griswold Corporation, a sub-contractor of the defendant and the plaintiff. It is further stated that the defendant, at the time of the execution of the release, failed to inform the plaintiff that it, the defendant, had already released *164the Cass-Warner-Griswold Corporation from all obligations and thereby knew that this sub-contractor was not liable for the item of $1790.25. In its amended replication plaintiff further states that had it known these facts it would have included this item in the settlement of December 31, 1956 and that the payment by defendant to the plaintiff would have been $31,306.77 instead of $29,516.52.
The defendant filed a demurrer addressed to paragraph four of plaintiff’s replication as amended setting forth that * * * "plaintiff has failed to allege that the consideration, which the said plaintiff admits that it received pursuant to said release, hád been tendered or returned to said defendant * * *.” The demurrer to plaintiff’s replication as amended was sustained, plaintiff allowed exceptions and the cause passed to this court before final judgment in accordance with the provisions of V. S. 47, §2124. The demurrer challenges the adequacy of plaintiff’s pleadings upon the ground that there are no allegations that the plaintiff tendered or offered to return the consideration it had received.
Under our Practice Act, the function of a demurrer is to test the sufficiency of a pleading in matters of substance only. Curtis Funeral Home, Inc. v. Smith Lumber Co., 114 Vt 150, 153, 40 A2d 531; Standard Register Co. v. Greenberg, 120 Vt 112, 115, 132 A2d 174. A demurrer admits, for the purpose of its consideration, facts well pleaded. Theberge v. Canadian Pacific Railway Company, 119 Vt 193, 197, 122 A2d 848; Gulf Oil Corp. v. Morrison, 120 Vt 324, 330, 141 A2d 671.
While there is a disagreement among the decisions of other states, and they have been said to be in square and hopeless conflict, the weight of authority is to the effect that, subject to some qualifications and exceptions, a person who executes a release and afterwards seeks to avoid its effect on any ground which will entitle him to avoid it, must ordinarily first restore the status quo by restoring, tendering, or offering to restore what he has received in return for the release, at least where it appears that it is of value. 76 CJS, Release §37a, pages 663, 664. The general reason appears to be that "he may not litigate his claim for damages while clinging to *165the fruits of the contract which he affects to disaffirm.” Gilbert v. Rothschild, 280 NY 66, 19 NE2d 785, 788, 134 ALR 1. In this State it may be regarded as a general rule that when one has received anything of value in settlement of a right of action, the contract of settlement, although obtained by duress and fraud, is a bar to a recovery at law so long as it is not rescinded by an offer to return the consideration in so far as it lies within his power to do so. Brainard v. Van Dyke, 71 Vt 359, 363, 45 A 758; Johnson v. Belanger, 85 Vt 249, 251, 81 A 621. Also see, Hoadley v. House, 32 Vt 179; Downer v. Smith, 32 Vt 1, 7; Town’s Admr. v. Waldo, 62 Vt 118, 122, 20 A 325; Brezinski v. Tyler, 115 Vt 316, 320, 59 A2d 221. A release is a contract. The law is well settled that in the case of an entire contract the defrauded party, if he desires to rescind, must do so in toto; he cannot retain what he has received under the contract and thus affirm as to part and then repudiate' as to the unfavorable portion of the contract. Evarts v. Beaton, 113 Vt 151, 155, 30 A2d 92. This general rule, however, is not inflexible. If the thing received as a consideration for a release is of no value at law to either party a rescission may be effected without its return. Johnson v. Belanger, 85 Vt 249, 251, 81 A 621.
The plaintiff, in its brief, seeks to justify or excuse its failure to allege a tender or return of the sum of $29,516.52 claiming that the sub-contract was made up of several distinct parts of which the item of $1790.25 was one. This is not supported by the pleadings. Plaintiff’s amended replication states that the item of $1790.25 was left out of the final settlement, yet it alleges that had it known of the release from the defendant to Cass-Warner-Griswold Corporation, a sub-contractor of both the plaintiff and defendant, it would have required payment of $31,306.77 instead of $29,516.52. Its claim that the item of $1790.25 was not within the contemplation of the parties at the time the release was given is inconsistent with the pleadings. Moreover, there is no averment in the amended replication that the Cass-Warner-Griswold Corporation was indebted to the defendant. It is merely alleged that the defendant told the plaintiff that it * * * "should recover” * * * "collect” * * * the sum of $1790.25 from the *166Cass-Warner-Griswold Corporation. While there is authority that where a release of a claim or claims is intended to relate to only a part of the claim or claims held by the releasor, a failure to tender back the consideration paid does not preclude the enforcement of the balance of the claim or claims. 45 Am Jur, Release, §53, page 713. In this case the pleadings fail to disclose such a state of facts. We construe the release as entire, not divisible. The plaintiff in effect does not desire to repudiate the release — yet seeks to escape its legal consequences. Its contention that no tender or restoration of the consideration was necessary is not tenable. No error appears. The remaining questions presented in the defendant’s brief require no consideration in view of our entry.
The order of the county court sustaining the demurrer is affirmed and the cause remanded.