You win but you may get stuck paying the borrow costs still for a while until either the stock is tradable or whatever happens with the resolution of the bankruptcy settles out (the residual shares potentially have _some_ value). In practice, before that, your broker or whomever you borrowed the shares from will probably just declare it a loss and close it out. They'll then get a little something from the bankruptcy, maybe.
That's assuming a traditional short, and not something like selling naked calls. In the latter case they just expire worthless.
Wrong, they are, ... um were, publicly traded under the symbol SIVB. [0]
Trading Halted. They were down 66% on the day before halt
On 08-March-2023, they were trading at $267.90, by the end of the 9th, 106.08. By trading halt today, $39.49. Now, it's worthless. Imagine thinking you got a bargain at $106, or $39...
What a guy.
[0] Thiel Fund, Venture Firms Advise Companies to Pull Money From SVB