You can't "undo" the movement of icons, but you can get them to line up along the side of the screen.
Click on your desktop, go to View > Show View Options > and select Keep Arranged By
Note than if you deselect that box, they should go back to where they were.
That may or may not put them in the order you want, but will get them out of the smiley face pattern. Otherwise, you'll just have to drag them back one by one. Selecting "Snap to Grid" helps if you want them lined up.