I have worked for some university. I got a grant from the government for a project. The department and the government specifically wrote a contract that I have an intellectual property (including the copyright.) Then the department took down the server and took the code while I was at a conference without any prior notice. (A member of faculty abruptly cancelled the conference and was on the notice.) Is it a copyright violation?
Unless they have copied the code without your permission: no.
Unless the contract says so, neither the university nor the government is responsible for the storage and backing-up of your code. If the only place you put it was on their server then this would be what's legally known as "your problem". If you ask nicely they may let you access their server (wherever it is) to get the code.