Bankruptcy is every business owner's worst nightmare. It seemed like the end when these businesses were going bust, but they didn't accept that fate. Here's what they learned after emerging from their darkest times.

Don't Put All Your Eggs in One Basket

"In early 2012, we executed a marketing strategy that seemed absolutely foolproof. By establishing links to our website from as many different sources as possible, we put ourselves at the top of Google's organic search results for practically every industry-related keyword.

But by mid-April of the same year, Google altered its search algorithm and found that the links to our website were "over-optimized." As a result, they gave us a ranking penalty and our traffic from Google dropped by 76.38 percent, while our overall traffic dropped by 64.45 percent. This put us in serious danger of bankruptcy.

Our dire situation required an elegant solution: Diversify marketing and obtain higher conversion rates. We completely overhauled our website with a new design and a better interface that better informed our buyers, and ultimately boosted our online quotes by 67.88 percent. We also invested in more content marketing with an informative blog, as well as guest posts and articles for other publications. Our Google rankings have steadily increased, but since it's no longer our sole marketing source, we've enjoyed a lot more stability.

Thanks to our ongoing efforts, we've made a full recovery and doing better than ever."

Vladimir Gendelman--Founder and CEO of Company Folders, Inc.

Take a Long-term View

"Our firm was hit head-on when 2008's recession set in. As banks changed their underwriting criteria and many stopped lending, a number of our clients filed for bankruptcy. Our client list all but disintegrated.

We cut expenses everywhere we could. We asked for (and sometimes had to take without asking) extended payment terms.T he skeleton staff worked partial days and took voluntary unpaid leave. Through all of this loss, we kept searching for an opportunity to utilize our skill set and serve a new market where clients were not filing bankruptcy and going out of business. Ultimately, we did identify a segment and after several years of painful "near-death experiences", we started growing again.

The most important lesson I've learned from this experience is that having cash reserves is all-important. Second to this: Forecasting and scenario analysis; these are critical in ensuring that a company can deal with tough times, which are inevitable and may threaten to decimate everything. As I look back, I realize that I was too focused on reinvesting money in the company and trying to land the next customer. I was not focused on where the industry or the economy might be going in the next 18-24 months."

Michael Hobbs--President of PahRoo Appraisal & Consultancy

Learn and Develop Resilience

"Before 2008, everything was going well at my company, so I decided to add another digital agency division to our existing digital marketing outsourcing business. Business started to grow and we got traction. Then the financial crisis struck.

As the business became cash flow negative and debt built up, I had to cut back on employees and expenses. I stopped experimentation and got the company to focus on the essentials just so we could keep the lights on. It was distressing knowing that my team and their families were suffering. Shortly after, my business partner and I fell out due to our frustrations and countless disagreements.

After many sleepless nights, I decided to sell the portion of my company that drew the most revenue and profit. From the sale, we could pay off all outstanding debt and I could buy out my business partner. I worked hard to rebuild relationships with all my past employees and partners, and keep the business going. I also increased my team's salaries back to where they previously were, and now it's stronger than ever. To my delight, my family felt more secure and started to smile again.

As business owners, we can easily get carried away in our successes. We don't think to prepare for hard times. There was no one to guide me through running a business through good times and bad, so I had to learn the hard way. By sharing my experiences, I hope others can avoid some of the financial turmoil I faced."

Rishi Khanna--CEO of ISHIR

Did you recover from near-bankruptcy as well? Please share your thoughts in the comments section below.