Most people rent and repair credit. Stay in your home as long as possible.
I'm not a financial planner and they might have a better answer.
I suggest trying everything you can to avoid foreclosure. This website might help.
There are also housing counseling agencies available on the site.
The State of Michigan may also be able to help.
A short sale will not hurt your credit as bad as a foreclosure so yo do need to consider that. Again, this is something that you should discuss with an attorney.
This is best done before you are behind on your payments. Even if you are behind it is still worth while to make the effort to work with you lender.
Late mortgage payments and a foreclosure will stay on your credit report for many years.