I am sometimes involved in panels that investigate unfair means. I am also in the position of checking my own students' code for suspected plagiarism, often by comparing code from a large pool made from the current and past submissions. There are several tools that assist with this, such as Moss and JPlag. I have experience with both these but there are others, and some that academics have made for themselves for local use.
It is quite possible, therefore, to get a match between a current student's submission and a previous student's submission without the lecturer or university knowing how that occurred. All they can do in this situation is to convene an investigation to determine the facts. Often these investigations are formal affairs, mainly to protect the interest of the students concerned and to ensure that the decision makers are impartial.
This is highly likely to be the position you are in. At the moment they do not know how another student came in possession of your code. If the investigation is organised properly you will be given the opportunity to explain your position, just as you did here. Most investigations should allow you to submit written and verbal statements. You should ensure you do this. I also suggest you seek advice from others who can assist you locally, such as a students union or student association or other student advisor. They will have assisted other students in the same position as you before and help you make the best of the procedure that you have become involved with.
Although it may not be your fault, at the moment the university does not know this. Help them to understand.