Nasa engineers have overcome a computer glitch that shut down the space agency's car-sized Mars rover, Curiosity, earlier this week.

The $2.5bn rover went into a precautionary "safe mode" on Sunday, when a command file failed a check by protective software on board the mobile science laboratory.

Richard Cook, at Nasa's Jet Propulsion Laboratory, said the fix was "a very straightforward matter to deal with" and was resolved by deleting the offending file. He said engineers knew how to prevent the glitch from happening again.

The rover has two computers it can switch between: the main A side, and a B side that acts as a backup. The latest computer problem arose when the rover was operating on the B side after an unrelated memory fault knocked out its A side.

Nasa mission controllers will now put the rover through some basic moves, including a test of its robotic arm, to check the computer is working properly. Information on the arm's position has now been sent to the B-side computer.

The cautious return to active service is expected to take a few days. "We expect to get back to sample analysis science by the end of the week," said Jennifer Trosper, Curiosity's mission manager.

A four-week moratorium on sending commands to the rover begins on 4 April when Mars passes behind the sun from Earth's perspective. The move is a precaution against interference from the sun that might corrupt signals being sent to the rover.

Touch down … How the Curiosity rover landed on Mars last August. Photograph: Nasa/JPL-Caltech/Rex Features

The rover has spent its time on the red planet exploring the huge Gale crater, where it has found evidence of an ancient watery habitat that may have been hospitable to microbial life.

The rover was not sent to Mars to look for life, but signs that the planet might once have supported life. Earlier this month, Nasa scientists revealed that rock samples drilled from the Yellowknife Bay area of Gale Crater contained clay minerals that had formed in a watery environment, along with other chemicals that can be used by living organisms, such as carbon, oxygen, hydrogen, phosphorus and nitrogen.

Speaking to reporters at the time, Michael Meyer, a lead scientist on Nasa's Mars Exploration Programme, said: "A fundamental question for this mission is whether Mars could have supported a habitable environment. From what we know now, the answer is yes."