To reverse a document in SAP, you use transaction code FB08. You enter the document number, company code, fiscal year, and a reversal reason. The system will generate a reversing document that posts the proper debit and credit amounts to reverse the original document. To reverse a document, access FB08, enter the required fields for the document to reverse, and post the reversing document. The system will confirm the reversal by posting amounts to offset the original document.