This research proposes a distributed switching control to secure multi-robot systems in the presence of cyberattacks. Two major types of cyberattack are considered: deception attack and denial of service (DoS) attack, which compromise the integrity and availability of resources, respectively. First, a residual-based attack detection scheme is introduced to identify the type of attacks. Then, a switching control is designed to neutralize the effect of the identified attacks, satisfying the performance guarantees required for state consensus among robots. For the type of a deception attack, coordination-free consensus protocols are designed to tune the weights of each robot in a way that uncompromised robots gain more weight than compromised robots. For the type of a DoS attack, leader-follower protocols that reconfigure the communication topology are utilized to transform the compromised robots into sub-robots following the leaders. The performance of the proposed approach is evaluated on the Robotarium multi-robot testbed. A full demonstration with extensive cases is available at https://youtu.be/eSj0XS2pdxI.