If I’m praying maghrib salat and and during tashahud I am not sure if it is my 2nd or 3rd rakaat but think it is my 2nd so I get up in qiyam and realize that it was most likely that it was my 3 rd rakaat and I should have completed the salat, should i just complete that 4 th rakat (now that I know its the 4th rakat), do the salam and end it and then do Sajdataw saww or is that entire salat void and I have to offer it again? Jzk

Whole salah is void. Doubts can only be repaired in 4 rakat prayers.