It depends on how you get released from jail on a bail bond. If you paid a cash bond, which means paying the full amount of your bail bond to get released, you will get that back no matter the outcome of your case, as long as you went to all of your court dates.
If you used a surety bond company to get released and paid them a percentage of the bail bond for them to post the remaining amount for you, you will not get that money back. That percentage, or premium, is the amount you pay for a bail bonds company to take the chance for posting your bond.