The landlord has to refund all of your deposit, except for the amount equal to the cost of repairs for damage you have done that is beyond wear and tear.
However, you are also obligated to honor the lease. If the landlord is able to lease at the same rate you were paying you are off the hook for additional rent. If they advertise for a higher rate than what you were paying (make sure you document this) then you are off the hook. If they agree in writing to release you from the lease, you are off the hook.
My recommendation would be to first try to make sure the conditions for getting “off the hook” are met, then worry about getting your deposit back.
These are general guidelines, based on my understanding and recent experience as a landlord in San Diego over the past decade. But, you may want to get legal advice.