Why can't you get it back? If you dragged it, it must be reachable with the
cursor.
With care - and maybe some trial and error - you can get it back using the
keyboard ...
When editing the header (with the toolbar 'displayed') ...
Press Alt, and "File" on the main menu will be selected/highlighted.
Press Ctrl+Tab repeatedly and the selection will move round the first item
on each visible toolbar. Watch where it goes and you should be able to
determine when it has reached the Header/Footer toolbar (presuming all the
rest are actually visible).
When on the Header/Footer toolbar, press Shift+Tab - this will select the
dropdown arrow at the top right of the Header/Footer toolbar.
Next press the down arrow to open the popup and then type "M" to select
"Move" within it, and press Enter.
The arrow keys can then be used to move the toolbar wherever you want.