I am a foreigner in country X, currently serving notice at a company A and recently got a job offer from company B. My work permit will be cancelled when I resign and I can stay at most 4 weeks in country X without work permit. So I need to be sure that I get a new work permit from the new company B on time.
HR from B told me that it's my decision whether I want to stay longer at A while they apply for a work permit. However, they were confident of securing the work permit by the end of my notice period at A and said that they'd prefer that I resigned from A immediately.
Following this, I resigned from A. But another foreigner friend of mine who switches jobs quite frequently in country X strongly advised me against my move when he came to know about it. This got me worried. I not want to resign so early, but I am eager to join company B and HR of B sounded very confident and made the other option sound unattractive by citing numerous delays about pushing back the start date.
What is a good way to tell HR of my new company that I changed my mind? I don't expect any problems like termination of the offer or something like that. I'm mainly looking for a good way to tell them I changed my mind, not how to deal with any potential issues that arise from that.