A dog has been put back on its leash after trying to run after a squirrel.