I did all of that. When connecting to iTunes it still said the same. So I closed iTunes, and reopened it while holding the shift key, and used the option to choose a previous library - and there were all my apps, music etc.
I just don't want the problem again next time I want to sync music etc. In future I think I will use iTunes just to back up, and find another way to transfer files.