Most likely a bad shift cable. As in it broke, or possibly just became unattached.
The usual configuration of the shift cable is that it "pushes" to get forward and "pulls" to get reverse, or out of forward. When the cable breaks inside the housing it can still push, so you can still get forward. The "pull" doesn't work, and thus you are stuck.
You should be able to confirm this by observing the linkage at the outdrive where the cable attaches. Have someone operate the shift while you watch. You might as well dig into whatever you need to as the probability is very high that you will need in there to replace the cable.
Once you have convinced yourself that you need a new cable you can save yourself some trouble if you go about it right. If you can establish how long the cable is without removing the old one then the easist thing to do is to tape the new one to the end of the old one so you can pull the new one in as you pull the old one out.
If you can't do that then attach a small rope to the end of the cable and pull that through as you pull the old one out. This will help you pull the new one in.
When you go to buy a new cable you may find that there are several different grades of cable. The primarly difference in the cable grade is how sharp of a turn they can make and not bind up. If you have a relatively straight shot then it doesn't matter much, but if the cable needs to make a tight radius turn, buy the more expensive cable.
Rod