Twitter is a platform which promotes free expressions of Individual. In theory, no one should be prosecuting for making a tweet.
But what if
1) A person feels that his reputation is damaged by tweet.or,
2) His feeling are hurt deeply.
Then he will take recourse to civil or criminal proceedings.
If you have deleted offensive tweet at earliest opportunity, then it is relevant fact to show that you had no ill intention or design to harm anyone.
If you have retweeted an offensive tweet and you had undo it as soon as you realized that retweet was wrong, then this is also a relevant fact to show that you had no ill will or design to harm anyone.
Advice is: Do not use names in tweet, do not attack anyone personally. Avoid trouble.
But if you get into trouble, there may be many Defenses that can be taken into court.
But you may have to undergo trauma of trial and results are unpredictable.
In Case of Defamation there are exceptions which permit statements made for public good.
The IT Act is technical. Some technical defenses may be available. These are new laws and yet not fully settled areas of laws. Risky waters.