The rule of thumb in bankruptcy is that 90% of the time shareholders get completely wiped out. Maybe 8% of the time shareholders get a tiny bit of equity in the new (post-bankruptcy) company or out of the money warrants to buy that equity. Only 2% of the time or less do shareholders get a large recovery. Of course, that 2% of the time is what gives hope to shareholders in the 98% of bankruptcies. General Growth Properties (GGP) is a good example from the 2008 financial crisis and American Airlines (AAMRQ at the time) is a more recent example from 2014. A current company in bankruptcy where it is possible that shareholders may get a meaningful return is Peabody Energy (BTUUQ); the current price values the equity at $250 million although the company still says that shareholders will be wiped out. Peabody has yet to file a bankruptcy plan; it has been granted an extension by the court until December 14th. [The above paragraph has been edited to specify that a meaningful return for equity holders is possible; a prior version said it was probable.]
There are a few key events in a bankruptcy proceeding that should drastically affect the stock. First, the bankruptcy filing, which almost always crushes the stock although in cases where that was expected the drop may be 30% rather than 80%. The next event is the formation of an equity committee (or rejection by the judge of an equity committee): this indicates a meaningful probability of shareholders receiving something and not getting completely wiped out. Next comes the filing of the bankruptcy plan, which lays out how much different classes of creditors and equity holders will get. For various reasons the bankruptcy plan is often changed or amended multiple times. Next comes the vote on the bankruptcy plan and approval by the judge: if the plan is approved then the bankruptcy will become ‘effective’ shortly thereafter. The effective date is usually not known more than a few days in advance and it should come a couple weeks after the plan is approved. On the effective date the bankruptcy is closed, old shares are wiped out, and new equity is distributed to creditors.
It is important to note that there are other (less common) ways that a bankruptcy can end: the old equity can remain after essentially all the assets have been sold with the proceeds going to the creditors (this is what happened recently with Saratoga Resources (SARA), and in this case the equity essentially owns a shell company).
Shareholders of a bankrupt company can keep the stock price at an unrealistic level even when they are likely to get wiped out. However, the events mentioned above tend to be catalysts for sending the stock price towards its fair value.
Here is a chart of Cosi (COSIQ); the big down day is when the company declared bankruptcy.

Next is the chart of C&J Energy (CJESQ) — November 4th in premarket the bankruptcy plan was revised to give shareholders 2/3 fewer warrants in the new equity.
The evening of November 4th the judge denied the request for formation of an official equity committee.

Here is the chart of Republic Airways (RJETQ): the bankruptcy plan was filed after-hours on 11/16/2016. The plan calls for shareholders to be completely wiped out and get nothing.

Next is the chart of Hercules Offshore (HEROQ) with the big drop on November 1st coming after the judge approved the bankruptcy plan:
The final even in bankruptcy is the effective date. As I stated above this is not known far in advance — it depends on if there are any objects or delays after the plan is confirmed. Below is the chart of Arch Coal (ACIIQ; the post-bankruptcy stock trades as ARCH). On September 30th the company filed an 8-K stating that the effectiveness date was anticipated as being October 5th. The stock promptly dropped bigly.

Republic Airways (RJETQ) and understanding a bankruptcy plan
An official equity committee was never approved by the judge because unsecured creditors were set to lose over 50% so the likelihood of equity holders getting any recovery was very low. The evening of November 16th a bankruptcy plan was finally filed. You can see the bankruptcy court docket for free. To find free bankruptcy court dockets, just Google “[company name] bankruptcy docket”. The various corporate bankruptcy trustees all make these available. In the case of Republic Airways, docket 1089 is the bankruptcy plan and docket 1090 is the plan disclosure statement.
The most important part of the bankruptcy plan is the listing of claimant classes and what they will receive at the confirmation of the plan. Here is that list for Republic:

Interests in RAH include the stock of Republic; but don’t take my word for that: the first part of the plan has definitions of all the relevant terms.
From page 9:
“Interest” means any equity security within the meaning of section 101(16) of the Bankruptcy Code including, without limitation, all issued, unissued, authorized or outstanding shares of stock or other equity interests (including common and preferred), together with any warrants, options, convertible securities, liquidating preferred securities or contractual rights to 16-10429-shl Doc 1189 Filed 11/16/16 Entered 11/16/16 18:56:36 Main Document Pg 14 of 68 10 purchase or acquire any such equity interests at any time and all rights arising with respect thereto.
From page 13:
“RAH” means Republic Airways Holdings Inc., a Debtor in these Chapter 11 Cases.
Page 25 has the details of how interests in RAH will be treated (emphasis mine):
i. Interests in RAH (Class 5) i. Impairment and Voting. Class 5 is impaired under the Plan. Holders of Interests in RAH are deemed to reject the Plan under section 1126(g) of the Bankruptcy Code and are not entitled to vote on the Plan.
ii. Treatment. Upon the Effective Date, all existing Interests in RAH shall be deemed cancelled and extinguished and the holders of such Interests shall not receive or retain any property on account of such Interests under the Plan.
If that isn’t clear enough, look at page 92 of the disclosure statement (emphasis mine):
2. Consequences to Holders of Existing Interests in RAH Holders of interests in RAH, which are being cancelled under the Plan, will be entitled to claim a worthless stock deduction (assuming that the taxable year that includes the Effective Date of the Plan is the same taxable year in which such stock first became worthless and only if such holder had not previously claimed a worthless stock deduction with respect to any Interest in RAH) in an amount equal to the holder’s adjusted basis in the Interest. If the holder held its Interest in RAH as a capital asset, the loss will be treated as a capital loss.
Republic stock gapped down after that bankruptcy plan was filed but thankfully bounced enough for me to short over $0.50. Considering that the company stated in a press release then that it expects to emerge from bankruptcy in the first quarter of 2017 and that the borrow rate on RJETQ at Interactive Brokers is under 4% APR (effectively 12% because that is calculated on short collateral), I continue to believe that RJETQ is a good short. I expect the stock to slowly fade over the coming two months and drop under $0.10 once the plan is confirmed.
Disclaimer. I am short RJETQ and may add to or cover my short at any time. I have traded all the other stocks mentioned but currently have no positions in them. This blog has a terms of use that is incorporated by reference into this post; you can find all my disclaimers and disclosures there as well.