Do I need to reinstall the OS before using adb restore? Assuming I did a full backup with 

adb backup -system -apk -shared -all -f "backup.ab"


And then went into the recovery on my phone and wiped it completely.  Do I need to reinstall the OS before using adb restore or must I install the OS first?



I ask because I'm in a bit of a bind where I was on the latest CM12 and backed up before attempting and failing to upgrade to CM13.  When I try to reinstall CM12, only an earlier snapshot of CM12 is available.  If I try to restore with adb after installing the snapshot, com.android.phone fails continuously.  I am wondering if the newer CM12 is still in backup.ab.
Backups made with the -system argument can't be restored to a different Android version. It's not that the OS itself is in the backup: it's that the settings from system apps are in the backup and can only be read by the same version that produced them.

Usually upgrading to a newer minor version (e.g. from an earlier milestone release to the stable release) will work fine, because the apps are designed to be upgraded that way: a newer version of the app can read settings saved with an older version. However, going backwards will almost always cause problems if there have been any changes. Obviously the older version can't understand the settings added by the newer version.

You need to find the same version of CM12 that you had before. Try to avoid using a snapshot or nightly build.