The robbery was reported at 2:59 a.m. at 18th and Capp streets. The victim, a 28-year-old man, told police that two men armed with a knife and a brick had approached him and demanded money.
When he refused to give them what they wanted, one of the would-be robbers hit him in the head with a brick and the pair fled, police said.
The victim was taken to San Francisco General Hospital to be treated for a cut to his eyebrow, police said.
The suspects, described as men in their 20s, were not found.