
4 Cal.2d 456 (1935)
NATHAN LEVY, as Trustee in Bankruptcy, etc., Appellant,
v.
A. M. DREW, Respondent.
L. A. No. 15332. 
Supreme Court of California. In Bank.  
October 16, 1935.
 Farnsworth, Burke & Maddox and James K. Abercrombie for Appellant.
 F. C. Huebner, Arthur H. Drew and W. H. Stammer for Respondent.
 THE COURT.
 A petition for hearing in this case after decision of the District Court of Appeal, Fourth District, was granted to give further consideration to the contention of the defendant that he was entitled to an offset against the claim of the plaintiff pursuant to section 68 of the Bankruptcy Act. Upon such further consideration we are persuaded that the decision of the District Court of Appeal correctly disposes of that question as well as the other questions involved. We therefore adopt as the opinion of this court the following portions of the decision of that court, prepared by Mr. Justice Marks:
 "This is an appeal by plaintiff from a judgment rendered in an action wherein he sought to recover from defendant the sum of $3,035.50. This sum had been collected by defendant under an execution issued on a judgment rendered in his favor in an action against the California Olive Growers, Inc., a corporation. We will refer to the California Olive Growers, Inc., as the corporation. The facts are not in dispute. *459"
 "A. M. Drew, an attorney at law, performed legal services for the corporation prior to September 19, 1927. On that day he commenced an action in the superior court of Fresno county to recover $3,035.50 from the corporation and caused its bank account to be attached. Summons was served and the parties entered into negotiations for a settlement of the claim. Pending these negotiations the default of the corporation was taken, judgment entered and execution levied under which $3,035.50 was collected and paid to Drew. Thereafter the judgment was vacated, the default opened and an answer filed. The case was not brought to trial and was dismissed for lack of prosecution on September 22, 1933."
 "On March 27, 1928, the corporation was adjudged an involuntary bankrupt and plaintiff was appointed, qualified and acted as its trustee. The scheduled debts of the corporation totaled $211,924.51, and its scheduled assets $17,787.45."
 "On November 15, 1929, plaintiff brought this action to recover the $3,035.50 which defendant had collected under the execution. Defendant maintains that he is entitled to retain the money collected under the execution as payment of his bill for services rendered. It was stipulated at the trial that the reasonable value of Drew's services to the corporation was $3,035.50."
 [1] "It is well settled in California that when a judgment is reversed on appeal the appellant is entitled to restitution of all things taken from him under the judgment. After reversal the respondent stands in the position of a trustee of appellant of the property obtained under the judgment. Restitution may be sought in the same or in an independent action. (Ward v. Sherman, 155 Cal. 287 [100 P. 864]; Asato v. Emirzian, 177 Cal. 493 [171 P. 90].) The same rule should apply where a judgment has been vacated by a trial court. A judgment, when vacated, cannot be effective for any purpose. (Lapique v. Plummer, 50 Cal.App. 88, at 94 [195 P. 293]; Sichterman v. R. M. Hollingshead Co., 117 Cal.App. 504 [4 PaCal.2d 181]; Thomas v. Lavery, 125 Cal.App. 666 [14 PaCal.2d 158]; Clarke v. Baird, 98 Cal. 642 [33 P. 756].) [2] We therefore conclude that defendant had no right to retain the money collected under the execution after the judgment upon which it was issued had been vacated. He urges that he caused satisfaction of the judgment to be entered after he had received the money from the sheriff. *460 This can avail him nothing as there remained nothing to satisfy after the judgment was vacated."
 "There remains for determination the question of defendant's right to offset his claim for services rendered against the claim of the plaintiff for restitution of the money unlawfully held by defendant. ..."
 [3] "The rule is consistently applied in the federal courts that when a debtor, prior to bankruptcy, voluntarily places in the hands of his creditor assets for the particular purpose of extinguishing a debt, and bankruptcy occurs, the creditor can offset his demand against the claim of the trustee in bankruptcy for a return of the assets to the bankrupt estate. [4] It is equally well settled that the unauthorized possession of funds of the bankrupt can give the creditor no right to apply them to the payment of his own claim to the prejudice of the rights of other creditors. (Emerson v. Fisher, 246 Fed. 642; Lehigh Valley Coal Sales Co. v. Maguire, 251 Fed. 581; Alvord v. Ryan, 212 Fed. 83; In re Interborough Consol. Corp., 288 Fed. 334 [32 A.L.R. 932]; Parker State Bank v. Pennington, 9 Fed.2d 966; In re Gans & Klein, 14 Fed.2d 116; Cook County Nat. Bank v. United States, 107 U.S. 445 [2 S.Ct. 561, 27 L.Ed. 537]; Hanover Nat. Bank v. Suddath, 215 U.S. 122 [30 S.Ct. 63, 54 L.Ed. 120].)"
 "In the instant case the money was not voluntarily paid to defendant by the corporation, but was forceably seized by the levy of an execution, nor was it voluntarily handed over to be applied on the particular debt owed to defendant. When his judgment was vacated defendant's possession of the money became illegal and he should have restored it to his debtor. It follows that defendant cannot offset the amount of his claim against the suit of the trustee in bankruptcy for the money which he unlawfully retained but must restore it and take his place among the general creditors of the bankrupt estate. ..."
 "In his petition for rehearing defendant maintains that we have fallen into error in concluding that he could not offset his bill against the California Olive Growers, Inc., against the money collected by him on the judgment against that corporation. His argument is based upon the fact that the collection was made by him more than four months prior to the bankruptcy of his debtor and the provisions of section sixty-eight of the Bankruptcy Act which contains the following: *461 'Set-offs and Counterclaims--(a) In all cases of mutual debts or mutual credits between the estate of a bankrupt and a creditor the account shall be stated and one debt shall be set off against the other, and the balance only shall be allowed or paid.'"
 [5] "As a basis for his argument defendant urges that he did not become trustee of the funds received by him and if he did the trust terminated upon the application of the funds to the payment of the judgment which evidenced the debt. He further argues that as there was no trust proven, because there was no attempt to trace the res of the trust, and as the res of the trust was not proven and identified, the evidence was not sufficient to establish a trust. The vice of this argument lies in the fact that this action need not be construed as one to recover the identical dollars paid defendant under the execution. The trust did not come into being until the order setting aside the judgment became final. (Garrett v. Jensen, 44 Cal.App. 99 [186 P. 156].) Up to that time the possession of the money by defendant was lawful. After that time the law imposed upon him the obligation of returning the money to the California Olive Growers, Inc. ... The argument that the beneficiary must identify the res of the trust in the possession of the trustee before he can establish the existence of the trust needs only its statement to demonstrate its fallacy. If money forms the corpus of the trust an unfaithful trustee would need only to mingle the trust funds with his own to defeat the trust if defendant's argument were sound. ..."
 [6] "Where money is collected by a judgment creditor under a judgment which is subsequently reversed it should be returned. (Bank of United States v. Bank of Washington, 6 Pet. 6 [8 L.Ed. 299].) Where money is paid by a bankrupt debtor to his creditor for a specific purpose and is not used for that purpose, the creditor becomes a trustee and holds the money in trust. (Lehigh Valley Coal Co. v. Maguire, 251 Fed. 581.) In this case it was said: 'Set-offs are authorized only in cases of "mutual debts or mutual credits". (Bankruptcy Act, July 1, 1898, c. 541, sec. 68, 30 Stat. 565; Comp. 1916, sec. 9652.) This does not enlarge or change--it only recognizes--what under general law may constitute set-offs. ... But where a creditor receives money from his debtor, with instructions not to apply it on the debt, *462 but to hold or use it for a specific purpose, the right of set-off does not exist, because the creditor has become, not the debtor of his debtor, but the trustee of a specific trust.'"
 [7] "In Libby v. Hopkins, 104 U.S. 303 [26 L.Ed. 769], and Alvord v. Ryan, 212 Fed. 83, it was held that the right of set-off under section sixty- eight of the Bankruptcy Act arises in the case of debtor and creditor and not in the case where the creditor holds money of the debtor as trustee."
 To the foregoing we may add that the question whether the opposing claims of the parties are matters of mutual offset or counterclaim under the particular facts must be resolved adversely to the contentions of the defendant under the authorities cited. The funds came to the possession of the defendant only for the specific purpose of application to the satisfaction of a final judgment in the action commenced by him against California Olive Growers, Inc. The event upon which that application could be made, viz., the rendition of a final judgment which would entitle the defendant here to retain the funds or any part of them in satisfaction thereof, never materialized. The defendant can now find himself in no better position by reason of his actual possession of the funds than if he had been the clerk of the court or some other third person with whom the money had been deposited for the specified purpose. When the contingency upon which he would become entitled to apply the funds to his own credit failed of fruition, the fund became subject to repayment by the defendant and, in this case, to distribution to the general creditors of the bankrupt, who, it may be assumed, have claims as just and undisputed as that of the defendant. In his position the defendant is subject to the rules applicable to a trustee and, as was said in Cook County National Bank v. United States, supra, "A trustee cannot set off against the funds held by him in that character his individual demand against the grantor of the trust. Courts of equity and courts of law will not allow such an application of the funds so long as they are affected by any trust." Also, in In re Gans & Klein, supra, it was said: "Moreover, the law is equally settled that he who secures possession of property or money upon his agreement to make certain disposition or application of it, is obligated to perform accordingly or to return the thing to him from whom possession was received. He cannot repudiate *463 his contract, and in advantage of his wrong, otherwise dispose of the thing to his own benefit."
 [8] These are the guiding principles applicable in this case. The fact that the defendant came into possession of the funds more than four months prior to the entry of the decree declaring the California Olive Growers, Inc., a bankrupt, can have no potency to prevent the application of those principles under the particular facts. It follows that the defendant was not entitled to judgment on his claim of offset against the claim of the plaintiff.
 The judgment is reversed.
