how get I get f1 status again if we have doubt getting h1b approved

I am on OPT now , will apply for h1b next year, I work for some small company its h1b approved and visa stamping rate is not good , moreover my GPA in Masters is also very low it is 2.98/4.0, , I want to stay in US for another 3 years atleast so I want to apply for some Masters degree , My question is how will I get f1 status again once if i get admission to a school after getting h1b(if it is just approved not stamped ) , my previous f1 visa itself is till 2015 think it will expire once i got h1b. so how can i continue as a student if i get h1b rejected and also can i get f1 status back if h1b is not stamped(if I am in India for stamping)?

If your H1B visa is approved, you can study while on H1b. See this link

If your H1B is rejected while your OPT is still valid you will still be in status.  You have up to 60 days after your OPT expires to change you status. So once a new I20 is issued before that deadline, you will be able to continue studying.