This is most likely a false or misunderstood hadith due to the fact that it contradicts many other authentic hadiths:
Ibn 'Umar said, "I heard the Prophet, may Allah bless him and grant him peace, say, 'The expiation for someone who slaps his slave or beats him more than he deserves is to set him free.'"
Grade: Sahih
It was narrated that Abu Mas’ood al-Badri (may Allaah be pleased with him) said: I was beating a slave of mine with a whip, then I heard a voice behind me saying, “Remember, Abu Mas’ood.” I did not recognize the voice because I was so angry, but when he drew close to me I saw that it was the Messenger of Allaah (peace and blessings of Allaah be upon him), and he was saying, “Remember, Abu Mas’ood; remember, Abu Mas’ood.” I threw the whip aside and he said, “Remember, Abu Mas’ood, that Allaah has more power over you than you have over this slave.” I said, “I will never beat another slave again.” Narrated by Muslim, 1659.
Grade: Sahih
'A'isha reported that Allah's Messenger (ﷺ) never beat anyone with his hand, neither a woman nor a servant, but only, in the case when he had been fighting in the cause of Allah and he never took revenge for anything unless the things made inviolable by Allah were made violable; he then took revenge for Allah, the Exalted and Glorious.
Grade: Sahih
This hadith that you mentioned has been expained over HERE:
http://www.islamweb.net/emainpage/index.php?page=showfatwa&Option=FatwaId&Id=198513