Your question is not easy to advise on because you haven't provided much information and why the two choices and to be exclusive. You could have your home foreclosed on or conduct a short sale and conduct a bankruptcy. However, you really should have a one-on-one discussion with someone competent in credit, legal and tax matters to discuss the merits of all options.
To get the answer to how long bankrupty, or foreclosure or a short sale will impact your ability to get a new home loan have a talk with a lender. Tell them you just went through bankruptcy how long do I have to wait to be able to get a home loan, then walk through your other scenarios.
SUNIL SETHI REAL ESTATE
Sunil Sethi / Broker, President, REALTOR, MBA, CPA / SUNIL SETHI REAL ESTATE
38750 Paseo Padre Pwky Suite B3 / Fremont, CA 94538
Main 510 388 2436 / Fax 510 431 9046
My Bio: http://sunilsethi.com/about_me.htm
My blog: http://fremontrealestate.blogspot.com/
CA DRE#: 01173766