I failed to mention that you need to have AP, but don't use AP.
If you are F1, you need to get AP before you can leave US. But you can use H1 visa to return and be in H1.
In your case, you must apply AP to keep I-485 alive, but don't use AP to return to get H1 status.