When does the encumbrance on a purchase order get reversed?

If the purchase order requires budgetary control, and you accrue at period end, the encumbrance reverses when you account for the matched invoice.