H1B transfer while COS is pending

I was earlier on H1B visa with for a client A. I had to resign due to some reason so applied for change of status to L2 and also applied for EAD at the same time

It’s been 4 months but still waiting for my approval. Company A is again offering me to join back. Can they sponsor my H1B while me COS and EAD applications is pending .

If yes then Is there a way I can switch back to my EAD after my EAD approval comes or will my EAD and COS application be automatically cancelled if company A is sponsoring my H1B?Please advise.