Unfortunately my laptop's wifi isn't supported by the normal Ubuntu releases. The only version that will work is the pre-installed version.
This is a contradiction. If it worked before on a previous installed Ubuntu it will always work (bugs excluded ;-) ). The manufacturer probably pre-installed something extra you failed to install with your installation.
Can the HP version of 12.04 be downloaded?
No. Well yes, but the HP website points you to http://www.ubuntu.com/download/desktop So you would still download the version you claim does not have a working wifi. So there is no HP version...
Or is there something I can do in the terminal to restore it?
If wifi is the problem, fix wifi. Re-installing a complete OS is (in my eyes) a waste of time. If needed please create a new question and, amongst others, include information about the chipset used for this wireless. But before you do that first have a look at some of the topics on AU regarding HP and wifi (cuz you will get your question closed as a duplicate):
- Wireless problems on HP
- in case it is a Broadcom BCM4311: How can I get Broadcom BCM4311 Wireless working?
- Wireless not working on HP pavilion dm5
- Why is Wifi not working on my HP laptop?
These show 2 general problems:
- the wifi could be switched off due to a hardware switch.
- the driver might be a BCM4311 and that needs to some extra installation.
It might also be solved blacklisting rt2800pci
(see the links above on how to do that). But there is a lack on details on the problem to actually help :)
In short: the version that worked probably had a module blacklisted and you did not know it was blacklisted and that is why your installation does not work.