Etymology
Today it means: In a way that is not desired. Full definition →
From undesired + -ly.
Etymology from Wiktionary, CC BY-SA 4.0.