Your question is a bit unclear because "walking away" normally means the same thing as a foreclosure.
Alternatives to a foreclosure include a short sale and a deed in lieu of foreclosure.
As for which alternative suits you best, I don't think it is possible to answer your question in the abstract. Is the property located in California? How much is "seriously" underwater? How is your credit score? Are you on the verge of filing for bankruptcy?
Frank W. Chen is licensed to practice law in the State of California. The information presented here is general in nature and is not intended, nor should be construed, as legal advice. This posting does not create any attorney-client relationship with the author. For specific advice about your particular situation, consult your own attorney.