The IPC 1860 was replaced by the BNS 2023 (in force 2024-07-01); no verified section mapping on file for Section 96 — confirm the corresponding provision (savings: Section 358, BNS 2023).
Nothing is an offence which is done in the exercise of the right of private defence.