Sayyiduna Jabir (may Allah be pleased with him) reports: The Prophet (peace and blessings be upon him) saw a man with disheveled hair and said: "Why does one of you make his appearance ugly?" Then he gestured with his hand, meaning: why does he not trim and tidy his hair?
Related hadith on this topic