Indian Kanoon- IPC Section 96
Things done in private defence
Nothing is an offence which is done in the exercise of the right of private defence.
This section means the act done in order to prevent oneself from harm will not be an offence (right to private defence is applicable only when the act done is equivalent to the injury you would have got if you didin't exercised your right to private defence), for eg. A is trying to stab B with a knife suddenly B picked a rod lying nearby him and threw it at A making him bleed, he can exercise his right to private defence.