A simple way to return it back is just to long press on the SPACE key and move to the opposite of the side which the small keyboard is, that is, towards the middle.
For the record, the keyboard goes to that mode when you long press on the SPACE key, and drag your finger to the left or right, then releasing. Its actually a feature that enables you to use a Windows 10 Mobile keyboard with a single hand. So I guess you were activating it accidentally by pressing on the space key and squishing the keyboard to either the left or right of the phone’s display.
Also, you can move the keyboard from the bottom of the screen to any point convenient to your liking.