Fixing missing Finder sidebar icons

I recently noticed that the icons in the Finder's sidebar for the various home directory subfolders (Desktop, Documents, Downloads, etc.) had been replaced by the generic folder icon:

Generic folder icons in the Finder sidebar

Needless to say, this would not do, and rebooting and relaunching the Finder were of no help. I found this StackExchange post, but none of the suggestions actually worked. What did wind up working was quite simple though: just touch each of the affected directories, drag it out of the sidebar and drag it back in. Best of luck if you're also affected by this issue!