Let’s be clear here – you CAN BUY A HOUSE after you’ve had a foreclosure – it’s just a matter of how long you will have to wait. USDA Loans generally have the LONGEST waiting period.
If the loan that you had to give up had a USDA loan on it – it is unlikely you will be eligible for another USDA Loan. We recently saw a situation where the person had a USDA Guaranteed loan that got behind, and was a short sale situation.
Even though the borrower eventually paid all of the past due money back to USDA, she was flagged in the system and was ineligible for a new USDA Loan for 3 years.

I try and answer all questions :)