iPhone 5 upgrading after syncing with iTunes
When you see the lightning cable and iTunes logo on your screen, it means that your iPhone has entered Recovery mode.

The best thing to do is to connect your iPhone to iTunes on a Mac or Windows PC and restore it. 
ITunes should display a popup saying that you connected an iPhone in Recovery Mode.

From the screen in iTunes, select restore or restore and update. (Actual button names could be different as what I say)

After you restored your iPhone you need to configure it. If you want, you can restore a backup from iCloud or iTunes when there's one available.