Does restoring from an iCloud backup enforce installation of the latest iOS? I accidentally deleted a lot of text messages on my iPhone 5 and would like to restore from iCloud by choosing "Erase all content and settings" and then restoring from a backup made last night.  However, my iPhone is running iOS 6 and I would not like to update to iOS 8.  If I restore my phone from the iCloud backup using "Erase all content and settings" will iOS 8 be installed or will it restore the iPhone with iOS 6 as it was last night?  I would try it out, but I would prefer to find out before rather than after...
No. Erase all content and settings keeps your current iOS. As long as you don't use an iCloud backup from a device with a newer iOS version you will be fine.