
95 B.R. 745 (1989)
In re SPORTS & SCIENCE, IND., INC., Debtor.
SPORTS & SCIENCE, IND., INC., Plaintiff,
v.
Thomas J. RIELLY; Bruce A. Rielly; BCE Development, Inc., Benefact Trustee Services, Nanette Sanders, Defendants.
Bankruptcy No. SA 88-05691 JR, Adv. No. SA 88-0635 JR.
United States Bankruptcy Court, C.D. California.
January 27, 1989.
Nanette D. Sanders of Lobel, Winthrop & Broker, Irvine, Cal., for defendants, Thomas J. & Bruce A. Rielly.
*746 Christopher L. Blank of Drummy, Garrett, King & Harrison, Costa Mesa, Cal., for defendant, BCE Development.
Robert H. Stopher, Santa Ana, Cal., for debtor.
JOHN E. RYAN, Bankruptcy Judge.
Defendants, Thomas J. Rielly and Bruce A. Rielly, brought a motion to dismiss for failure to state a claim upon which relief may be granted pursuant to Bankruptcy Rule 7012(b) (the "Motion"). Defendant BCE Development, Inc. joined the Riellys in the Motion. I granted the Motion with respect to the third, seventh and eighth causes of action and allowed debtor 30 days to amend. With respect to the first and second causes of action, I took the matter under submission and requested further briefing.

JURISDICTION
This court has jurisdiction over this adversary proceeding pursuant to 28 U.S.C. § 1334(a) (the district courts shall have original and exclusive jurisdiction of all cases under Title 11), 28 U.S.C. § 157(a) (authorizing the district courts to refer all Title 11 cases and proceedings to the bankruptcy judges for the district) and General Order No. 266, dated October 9, 1984 (referring all Title 11 cases and proceedings to the bankruptcy judges for the Central District of California). This matter is a core proceeding pursuant to 28 U.S.C. § 157(b)(2)(A).

STATEMENT OF FACTS
In its first cause of action, debtor seeks to set aside a foreclosure sale, alleging that the sale was held in violation of § 362 of the Bankruptcy Code and, therefore, is null and void. Debtor also seeks to invalidate the same foreclosure in its second cause of action because the sale allegedly violated § 549 of the Bankruptcy Code.
In order to understand the context in which these issues are presented, it is necessary to review the background of this case. On January 6, 1988, debtor filed its first petition for relief under Chapter 11 (the "initial case"). At the time of this filing, debtor owned certain real property located in Newport Beach, California (the "Property").
On January 22, 1988, defendants held a non-judicial foreclosure sale of the Property. Defendant, BCE Development, conducted the sale and Thomas Rielly, also a defendant, purchased the Property.
Debtor filed an adversary proceeding to set aside the foreclosure sale. Debtor retained possession of the Property. On June 10, 1988, the U.S. Trustee filed a motion for dismissal or conversion of the case because debtor failed to pay the U.S. Trustee's fees. I dismissed the case based on the agreement of the parties. Debtor states that it did not oppose the dismissal because it thought it had a settlement with defendants.
On September 23, 1988, debtor filed a second Chapter 11 petition (the "present case"). It also filed this adversary proceeding to set aside the non-judicial foreclosure sale of the Property.

DISCUSSION
To resolve these issues, it is necessary to understand the interrelationships between § 362, § 549 and § 349 of the Bankruptcy Code. After the filing of a petition in bankruptcy, § 362 automatically stays any act to seize property of the estate. The foreclosure sale occurred after the filing of the initial case and, therefore, violated the automatic stay.
Section 549 empowers a trustee to avoid the transfer of property of the estate "that occurs after the commencement of the case; and . . . that is not authorized under this title or by the court." 11 U.S.C.A. § 549 (West 1987). This language implies that a trustee has discretion to avoid a transfer of property of the estate conducted in violation of § 362. By reason of § 1107(a) of the Bankruptcy Code a debtor in possession has all rights of a trustee.
Section 349(b) of the Bankruptcy Code describes the effects of a dismissal. According to this provision, dismissal of a case reinstates any transfer avoided under certain sections of the Bankruptcy Code, *747 including § 549, and revests property of the estate in the entity that had the property before the commencement of the case. The court, however, may for cause order a different result.
According to the legislative history, the purpose of § 349(b) is to
undo the bankruptcy case, as far as practicable, and to restore all property rights to the position in which they were found at the commencement of the case. This does not necessarily encompass undoing sales of property from the estate to a good faith purchaser. Where there is a question over the scope of the subsection, the court will make the appropriate orders to protect rights acquired in reliance on the bankruptcy case.
H.R.Rep. No. 95-595, 95th Cong., 1st Sess. 338 (1977); S.Rep. No. 95-989, 95th Cong., 2nd Sess. 49 (1978), U.S.Code Cong. & Admin.News 1978, pp. 5787, 5835, 6294. It appears then that unless the court orders otherwise, all property of the estate reverts to the pre-petition owner.
Defendants argue that dismissal of the initial case annulled the automatic stay, thereby validating any prior violation of the automatic stay. Debtor responds that a foreclosure sale in violation of the automatic stay is null and void.
To determine whether the foreclosure sale is voidable or void, the analysis of the court in In re Brooks, 79 B.R. 479 (9th Cir. BAP 1987), is instructive. The court stated that
[t]his suggests that a post-petition transfer in violation of the stay is not absolutely void once committed, but rather voidable. Subsections (b) and (c) of § 549 describe specific instances when the trustee may not avoid certain actions. Section 549 would have no purpose if post-petition transactions were treated as absolutely void.
Id. at 480.
The Brooks court addressed the apparent conflict between its holding and the Ninth Circuit's statement in In re Sambo's Restaurants, Inc., 754 F.2d 811 (9th Cir.1985), that "[t]he general rule is that actions taken in violation of the automatic stay are void." 754 F.2d at 816. In discussing Sambo's, the Brooks court states that "[a] closer look at the case reveals that it actually supports the idea that a technical violation of stay will not necessarily make that violation void." Id. at 481. Later in the decision, the Brooks court states that "[t]hese varying powers show a Congressional intention that acts taken in violation of the stay are not void but voidable." Id. at 482.
The court in Sambo's did not really analyze § 362 and its interrelationships with other sections of the Bankruptcy Code. It stated the general rule citing Collier's for its support. It did not address the issue of voidability versus void. In contrast, the Brooks court analyzed § 362 in light of § 549 and thoughtfully concluded that a post-petition transfer in violation of the stay did not void the transfer, but rather caused the transfer to be voidable at the trustee's discretion. I support the reasoning of the Brooks court and hold that the foreclosure sale was not void.
Since the foreclosure sale was not void, the next issue is the effect of the dismissal. As previously discussed, § 349(b) attempts to place the parties in the same position they had prior to the commencement of the case. Section 349(b)(3) provides that unless the court orders otherwise, a dismissal "revests the property of the estate in the entity in which such property was vested immediately before the commencement of the case under this title." 11 U.S.C.A. § 349 (West 1979). Debtor held the Property prior to the filing of the initial case. Since the initial case was dismissed, § 349(b)(3) appears to revest the Property in debtor. The legislative history clearly explains that this provision was not intended to unwind sales to bona fide purchasers. Logically, transfers made in accordance with the Bankruptcy Code and orders of the court would also not be unwound. This view is reinforced by the specific authorization in § 349(b) allowing the court for cause to order a different result than what otherwise would automatically occur by operation of this *748 provision without further action by the court.
There was no order of this court modifying the outcome of § 349. Fairness dictates that defendants should not gain an advantage by conducting a foreclosure sale in violation of the automatic stay. Defendants conducted the foreclosure sale without seeking relief from the automatic stay. Because they did not get this court's permission, § 349(b) controls and revests the Property in debtor.
Debtor's first cause of action indicates that the foreclosure sale should be deemed void because defendants violated the automatic stay. As previously discussed, this is not a proper basis for invalidating the foreclosure sale. With respect to debtor's second cause of action, it alleges that the foreclosure sale should be invalidated pursuant to § 549. Again, this is not a proper basis for the relief. Accordingly, the Motion to dismiss the first and second causes of action is approved. Debtor, however, shall have 30 days to amend to state a cause of action to unwind the foreclosure sale and clear title to the Property pursuant to § 349(b)(3) of the Bankruptcy Code.
Separate findings of fact and conclusions of law with respect to this ruling are unnecessary. The within memorandum opinion shall constitute my findings of fact and conclusions of law.
