A surgical stapler includes a first elongate member having a distal portion that supports a plurality of staple forming pockets, a second elongate member having a distal portion that receives a staple cartridge, and a clamp member operable to releasably clamp the first and second elongate members together. A retaining member is provided on one of the first elongate member or the second elongate member and is configured to releasably couple proximal ends of the first and second elongate members together with a resilient bias such that the first and second elongate members are pivotable relative to one another at the proximal ends. A decoupling mechanism is configured to overcome the resilient bias of the retaining member and thereby decouple the proximal ends from one another in response to the first and second elongate members being pivoted away from one another.