The IPC 1860 was replaced by the BNS 2023 (in force 2024-07-01); no verified section mapping on file for Section 76 — confirm the corresponding provision (savings: Section 358, BNS 2023).
Nothing is an offence which is done by a person who is, or who by reason of a mistake of fact and not by reason of a mistake of law in good faith believes himself to be, bound by law to do it. Illustrations (a) A, a soldier, fires on a mob by the order of his superior officer, in conformity with the commands of the law. A has committed no offence. (b) A, an officer of a Court of Justice, being ordered by that Court to arrest Y, and, after due enquiry, believing Z to be Y, arrests Z. A has Committed no offence.