If your H-1 is still valid, you have no restriction as long as you return before visa expiration. Your pending AP may be affected due to your leaving before its approval.