A Deed in Lieu of Foreclosure is an option for some homeowners who have fallen behind on their mortgage payments. In essence, this option will cancel the loan on the home for the home buyer, as he or she will give the deed (ownership) of the home back to the lender. It's different from a foreclosure because it's a straight-up deal -- an effort to avoid foreclosure is beneficial to the consumer and the lender because they both get something out of it -- the consumer gives up his home to avoid foreclosure, the lender accepts the deal to avoid losing profits on a property.
In most instances a deed in lieu of foreclosure is easier on consumer credit history and has a distinguished advantage above short sale in that the homeowner is not the responsible party for finding a new home buyer.
While it may not be easy to just walk away from an investment, it may be easier to walk away than enter a short sale, which is very damaging to credit history, or accepting foreclosure, which is also harms credit substantially.
If you can successfully offer your lender a deed in lieu of foreclosure, you'll have to walk away from your property completely, but it will in many instances be your best choice. You may still have to file for bankruptcy in certain circumstances, for example, if the home was what you used to collateralize debt with another lender, or if you are still left behind on other payments on car loans or credits cards.
It might be up to you to prove to your lender that the deed in lieu of foreclosure is good for them too -- they're not in the habit these days of wanting to hang on to more real property, but by the same token, they're not big on paying for all of the paperwork and rigmarole of foreclosure either.
If you think this is a viable option for you, discuss it with your bankruptcy attorney first to be sure there are not other choices that won't work better for you.