S1E20 — Andy Saves Barney's Morale
The Andy Griffith Show — Season 1, Episode 20.

When Andy has to leave Mayberry for the day to testify in a court case held in a neighboring town, Deputy Barney Fife is left in charge of the sheriff's department -- and he proceeds to arrest everyone in Mayberry!
View all episodes of The Andy Griffith Show