Hello. If "fastboot erase all" messed up your imei then there is no way to get it back. Trust me i have spent a considerable time to retrieve it back. First all as i have mentioned earlier and with lost101, we agreed on the following:
1. fastboot erase all deletes IMEI
2. The following partitions are erased with above command: hob,dhob,fsc,modemst1,modemst2,fsg
3. fsg,modemst1,modemst2 are restored when flashing stock rom but not hob,dhob,fsc which implies IMEI is stored in one of those.
4. modem requests for read/write permission to dhob and hob on bootup further strengthening theory.
5. These partitions do not get mounted on bootup only in fastboot. So unless you have custom bootloader that can access these partitions in boot mode, there is probably no way to get IMEI back.
But, if you messed up your radio and your IMEI is "Unknown", then there is very much chance to get back your IMEI. Just flash compatible radio. This case happens mostly when flashing cyanogens or other custom firmwares. As you can read on other posts people flashed their stock back and hence their IMEI is restored which actually was never erased and was there the whole time.
Lastly, trying to write IMEI with NV writing method such as DFS or any other tool will not bring back IMEI as it doesnt really write anything. IMO NV_550 variable which holds IMEI in most devices is useless in MotoG as i checked with DFS, it gave error unknown variable meaning MOTO G does not support it.
Hope that helps.