Cannot restore OR upgrade firmware after jailbreak
I had firmware 3.1.2 and jailbroke with blackra1n. The jailbreak went fine, Cydia was downloaded, and I managed to select "make my life easier" in its options... But then Cydia stopped working. I decided to restore my device with iTunes to the factory settings but it gives me error messages (not eligible for this build, etc.). I tried downloading the 3.1.2 file that can be found online, and clicking the restore button in iTunes while holding shift to select that file, but I get error messages again.
I understand from another thread that Apple no longer supports 3.1.2, but I would think iTunes would automatically upgrade me to whatever it DOES support now. Is this not the case? I really don't know how to un-jailbreak this device. It doesn't matter to me what firmware version I switch to at this point...
Any suggestions for what went wrong and how I can fix it? Thanks.