Detective Botha was removed pending the result of an investigation into seven counts of attempted murder.
National police commissioner Mangwashi Phiyega announced the change after a third day of testimony at Mr Pistorius's bail hearing.
Mr Pistorius, 26, denies murdering his girlfriend Reeva Steenkamp, 29.
Ms Steenkamp died after being shot three times at Mr Pistorius' home on 14 February.
Ms Phiyega said the police had received feedback from state prosecutors about Det Botha only on Wednesday.
By Andrew HardingAfrica correspondent
The news Hilton Botha is facing reinstated charges of attempted murder has stunned everyone. The immediate question is what impact, if any, the news may have on the prosecution argument that Mr Pistorius should not be allowed bail pending trial.
The timing of the reinstatement of the charges is still unclear and the National Prosecuting Authority says they are in no way connected to the athlete's murder case. It is curious, though, that the information about Det Botha was not provided to the Pistorius defence team or, apparently, to the prosecution.
Some might argue that Det Botha, who wilted under strenuous cross-examination by the defence, eventually conceding that he had not yet seen any evidence to contradict the athlete's version of events, has already done enough damage to the prosecution's call for Mr Pistorius to be denied bail and that the new revelations may not affect the magistrate's decision significantly.
She described him as an "experienced detective" who was not yet facing any criminal charges.
However, she said she was using her authority as national police chief to ask Lt Gen Vineshkumar Moonoo to take over the Pistorius case.
Gen Moonoo is reported to be a veteran of some 30 years service. He will work with the police chief in Gauteng province on a case Ms Phiyega said required attention "at a national level".
"We recognise the significance, the importance and the severity of the matter," she said of the Pistorius case.
She denied that the decision to replace Det Botha was embarrassing for the police. He has not been suspended and could remain a potential witness in any trial.
The BBC's Pumza Fihlani, in Pretoria, says the claims against Det Botha refer to a 2009 incident in which he and several other officers allegedly opened fired on a minibus taxi carrying seven passengers when the driver apparently disobeyed an order to stop.
The detective is expected to appear in court in May, reports say.
In court on Thursday, defence and prosecution lawyers offered their final arguments.
The magistrate is expected to issues his ruling on Mr Pistorius's bail application on Friday.
Lead defence lawyer Barry Roux asked for the charge of premeditated murder to be downgraded, and said Det Botha's contradictory evidence on Wednesday had undermined the prosecution's case.
Mr Roux said: "The poor quality of the evidence offered by investigative officer Botha exposed the disastrous shortcomings of the state's case."
The defence counsel said the fact that Mr Pistorius had carried Ms Steenkamp downstairs showed he was desperate to save her life.
Mr Roux added that the "known forensics is consistent" with the sprinter's version of events, and that a post-mortem examination showed Ms Steenkamp had an empty bladder at the time of her death.
That would indicate that she visited the bathroom of her own accord, rather than to escape her boyfriend, he said.
On Wednesday, Det Botha told the court that the trajectory of gunshots through the bathroom door indicated that Mr Pistorius, a double amputee, was wearing his prosthetic legs and shot downwards through the door.
This contradicted an earlier account given by Mr Pistorius, who said he was walking on his stumps and grabbed his gun because he felt vulnerable when he thought an intruder had entered his home.
What happened on the night?
But Det Botha also amended his testimony on the proximity of the witness who he said had heard arguments.
He said police had lost track of ammunition found inside the house, and was also accused of not wearing protective clothing at the crime scene.
The defence also countered police suggestions that testosterone and needles had been found in Mr Pistorius's bedroom, arguing instead that the substance was a herbal remedy called Testocompasutium co-enzyme.
On Thursday, prosecutor Gerrie Nel told the court that Mr Pistorius should not be granted bail simply because he is famous.
He branded Mr Pistorius as a man "prone to violence" who threatened Ms Steenkamp and eventually killed her.
He was critical of Mr Pistorius' sworn affidavit read to the court on Tuesday, said the athlete had a history of violence as described him as "willing and ready to kill".
South Africa's top detective is to take over the Oscar Pistorius inquiry amid attempted murder accusations against current lead officer Hilton Botha.