Sold Holding, and Buy Same Share Again

Today I have sold 2 reliance holding, and purchased 1 share again. What are the effect.
I sold it after a gain of around 5%. And repurchased it again after it was down. Please explain me the complete effect.
As I can see negative values in positions.

Share screen shot of Order Book

Check attached two images.

You shorted 2 Qty. It went against you. It is not 5% but 5 points. You lost 5 points in one share.
If you did not buy remaining one before market close it would be debitted from your Demat account.

My question is, the one is sold will I get the profit of that? As I have sold after around Rs 45 gain.
Secondly the one I repurchased will it attracts any charges or tax? Or nothing will happen to that.

You have not given price at which you bought. If it is in profit then it will be credited to your account after deducting charges.
The one you sold attract charges Rs. 40 brokerage both sell and then buy and Rs. 5 loss. Plus other charges.

See, brokerage will not be ₹40 but 0.01% of the turnover value as it is the lesser of the two.

I purchased two reliance share long back
Sold both of them today with gain of Rs 50. So total Rs 100
And after sometime repurchased it.

So I can understand my Rs. 5 loss, but what happen to my Rs 50 gain?

You will get 50 in one and lose 5 in another. Net 45 you will get