How to put lcloud continent from IPhone to Mac?

I just restored my Mac back to factory settings and i had all my iphone photos and notes and reminders and contacts all on my Mac and now they are gone and how do i get them back?

App store

On your Mac computer, just enter your User Name and Password for iCloud.

Once your Mac computer is logged in, iCloud will sync everything from your iPhone.

TIP: Open iCloud using System Preferences on the Dock.