Earbud wire color shielding is red/white and yellow/black, which are the grounds?
Probably white and black, although it shouldn't really matter, assuming that the earbuds are passive, as the speakers in the earbuds are basically just a coil and there is no directional preference in which direction the current flows.

It would be best to test them briefly, by connecting to an audio source and seeing which way around the music sounds better. So long as the volume on the output is low, then no damage should occur.