In theory you get the money back. In practice, you have to borrow the money from a bail bondsman who has the cash on hand to post bail, and then pay him a percentage for his services.
There are also jurisdictions which charge filing and handling fees on bail, which you never get back, which can be up to 10%. For 10k bond, which is pretty normal many places, that means 1000, just gone, not even accounting for the bond.