What did an archer do when he had to fight hand to hand, what weapons did he use for up close fighting?
There is already a good thread about this here What did archers do when they ran out of arrows.
But to answer your question in short, they would have most likely used whatever was on hand. From swords and knives, to axes and hammers. Typically though Archers avoided close combat fighting and were protected by other units.