A surgical device has a handle assembly and an elongated member extending distally from the handle assembly. A tool assembly is mounted to a distal end of the elongated member. The tool assembly has a cartridge assembly having a plurality of staples. The tool assembly further has an anvil assembly. At least one of the anvil assembly and the cartridge assembly is movable in relation to each other between open and closed positions. At least one of the anvil assembly and the cartridge assembly has at least a portion configured for transitioning between a longitudinally extended state and a longitudinally retracted state. A transitioning mechanism is configured to transition at least one of the anvil assembly and the cartridge assembly between the extended and retracted states.