Sue Gove wanted to keep Bed Bath & Beyond Inc. out of bankruptcy. Few believed it was possible. Alarmed by the retailer’s deteriorating finances, banks in January had cut off their credit lines and pushed for the company to start a liquidation, including selling off inventory, to repay their loans, according to a Wall Street Journal analysis. Gove, Bed Bath & Beyond’s chief executive, and her team sought a delay. They told the lenders they needed more time to set up bank accounts to make payroll in bankruptcy, the people said. They also were seeking a lifeline. Watching the drama from his home office in suburban Connecticut, George Antonopoulos, a managing partner at hedge fund Hudson Bay Capital Management, saw a troubled company that had at least one thing going for it: the passionate interest of individual investors who were keeping its stock price afloat despite an expected bankruptcy. Working with Hudson Bay’s co-founder, Yoav Roth, and others at the fund, Mr. Antonopoulos determined Bed Bath & Beyond’s shares could be an attractive investment — as long as the fund could get a guaranteed below-market price. Their thinking: Bed Bath & Beyond was a storied brand. If it somehow could turn around its fortunes, an investment at these levels would lead to big gains. But if the company’s prospects turned bleaker, the Hudson Bay team knew there was a good chance they could dump the retailer’s shares without losing too much money, thanks to the high investor interest in the stock. The unusual $1 billion financing arrangement — with $225 million upfront and installments paid over the rest of the year — will buy the unprofitable retailer more time to fix its business. The hedge fund stands to profit as long as the company can stay out of bankruptcy court this year and its stock stays above 72 cents.