The same thing happened to me over a year ago. My contacts are still messed up because I noticed the problem only over a month after it had happened and I had also done enough changes on both my phone and Google web that I didn't dare trying a roll back to a backup that I had taken myself. So, I've just lived with it and cleaned up the contacts as I've run into messy ones sometimes manually looking at my manual Google Contacts exports.
I would suggest to simply wipe out your phone contacts and have pull the contacts from Google online since you are saying that they look fine there. You can wipe out your phone/device contacts e.g. via Android Settings ->→ Application Manager.
Then it depends a bit on your Android version but on my phone (Galaxy S5) I need to go over to All (applications) tab and then find Contacts, Contacts Storage and Google Contacts Sync and if I wanted to clear my contacts I would clear both data (by tapping Clear data) and cache (by tapping Clear cache) of all of the above-noted three applications.
As said, the apps that store your contacts data and information about sync status depend on your device so just clear all contacts related data and then re-sync the Google account in question via Settings ->→ Accounts.
Now, even if the changes have been pushed over to Google by now you can roll back your online contacts with the rather powerful rollback feature of Google Contacts. It should be noted that the rollback is available for any moment in time within the past 30 days (and no longer!). So, if you spot the issue within a month of when it happened you can roll back easily.
You can find / do this through http://google.com/contacts -> More : Restore contacts...https://contacts.google.com/ → Left side menu bar → Undo changes
If you need to roll back what I would do is first disable the contacts sync from Android Settings ->→ Accounts (for the Google account in question). Then roll back the Google online contacts and then re-enable the account causing the sync to happen.
I hope this helps!