you had an approved I-140 which is the reason you could get H1 beyond 6 years.
When you got hire back by the I-140 sponsor, you were able to file I-485 again. you would not be able to file I-485 again without the employment letter from I-140 sponsoring company.