So there are two ways to go about retrieving a lost companion (this will not work if your companion is dead, you will need to resurrect first)
The first method works great if you have a previous save you can revert to to simply target (open console by hitting ~, and click on them) the companion that is lost. After targeting your lost companion in the previous save you will then switch over to your current save, open the console and type "moveto player" without the quotes. If your companion is alive but lost in the world that should teleport them right to you.
The second method just requires the ID associated with the companion you've lost which helps if you are having save issues. Just load up your save, open the console and type "prid XXXXX" where X is the item ID... that will select your companion in the world. After selecting the companion you just type "moveto player" and that should take care of it.
