Tesla Inc. is losing its general counsel after just two months on the job, replacing the veteran trial lawyer with a longtime insider who helped the electric-car company navigate some of its biggest legal issues.

Dane Butswinkas is leaving the auto maker to rejoin Williams & Connolly, the Washington, D.C., law firm where he had spent almost 30 years before being hired by Tesla in December, the company said Wednesday.

Mr....