Shulchan Aruch, in Choshen Mishpat 291, says:
[:1] An unpaid watchman is exempt, with an oath, for theft and loss and is liable to pay only for breach of duty.
[:2] An unpaid watchman is someone who was given money, items, an animal, or anything to watch and who accepted the responsibility to watch it.…
And in 294:
[:2] …If [the watchman] claimed it was stolen or lost: If he says this occurred in a place that eyewitnesses are prevalent, he should bring witnesses a proof to his words and he's exempt even from [having to take] an oath; and if he doesn't bring witnesses, he must pay. But if it's in a place that witnesses are not prevalent, then he should swear that [what occurred] is what he said. They draw out in his oath that he did not breach his duty of watching and but watched it as watchmen do and that he did not (prior to [the theft or loss]) use the object (for if he did he'd be liable even in a case of total accident).
Actually, I think the oath also includes that it's no longer in his possession. In any event, all these rules have many details that I'm not including. (Chapters 291–302 are all about an unpaid watchman.)
But some hold that even if there are eyewitnesses to the fact that the item was stolen or lost, he must swear he did not breach his duty and they draw out in his oath that he did not use the object. But if there are witnesses that he did not breach his duty, then he need not swear that he did not use the object.
(S'ma :5 offers an explanation for the last point: We don't really suspect him of committing such a terrible misdeed as to use the object.)
Further in 294, SA continues:
[:5] If the bailee [=watchman] stipulated he'd be exempt from an oath, that stipulation stands.
Nowadays, my understanding is that Jewish courts are very loath to allow anyone to take an oath. I would not be surprised if they considered there to be automatic stipulation that the watchman be exempt from an oath, but I have not heard that that's the case. Perhaps someone else can answer with a more modern understanding of these issues. In any event, such an oath would be taken only if administered in a Jewish court.
Aruch Hashulchan 294:7 adds:
One can wonder whether, if the matter occurred in a place that eyewitnesss are prevalent, he must bring witnesses [to be exempt]. Did [the bailor] not exempt him from that [by stipulation, but only from an oath], or, since the eyewitnesses stand in place of an oath, perhaps since he needs to take no oath he also needs no witnesses. This requires further investigation.