before changing your branch completely my suggestion is to go through the eligibility criteria of admission in M Tech from which you will know about the relevant degree required in that course.This may be different for all IIT’s so go thoroughly from all brochure of all the IIT’s.
Nevertheless if you are confident enough secure under AIR 100 in GATE from CS paper ,opt for M Tech in IISC Bangalore or IIT Bombay and that too if you will crack the interview.