Your H1B is your work authorization. You can keep your place in the green card line if you switch after your i140 is approved. If yo switch before that you apply for PERM and i140 again.
Just to be clear, if you switch after your I-140 is approved but before your I-485 is filed, you will keep your priority date and your place in line but a new PERM will need to be filed.