If you have a bridge nearby or tall pier (when the tide is out), it's sometimes possible to pull up alongside and have a friend positioned on the bridge/pier with a boathook to grab the halyard and quickly attach a messenger to it. Otherwise you may need to get a friend to hoist you up in the bosuns's chair on the
jib halyard to grab it.