With a flexible ISA, you can withdraw money and pay money in and it won't count towards your annual allowance of £20,000.
If you want to pay money back in to your ISA, you'll need to do this in the same tax year you took it out. This will mean it falls under the same year's annual ISA allowance.
You'll also only be able to pay money paid in in previous years back into the same ISA with the original ISA provider.
If you close or transfer your ISA, you won't be able to pay money in to cover previous years' contributions.
To find out more about your ISA's flexibility, have a look at your terms and conditions and Key Product Information sheet.