Open skills panel (default key: k) and find it and drag it back
In addition to this, one thing I found helpful for my own play was mapping a shortcut key for locking the action bars. When locked, you won't accidentally drag skills off the bars.
I do not recall where exactly in the keybind list that is, but you can use the search on the options window to help locate it. I usually use Ctrl-L as my lock/unlock.
This prevents you from dragging skills off your quickslots by accident
Once a skill is acquired, it auto slots to the next available slot.
If you wish to move it just unlock the quickslot bar, move skill, lock bar
Even when a Quickslot is locked, anything in that quickslot can still be used