Draw the outline of a 4-inch by 2-inch rectangle onto a new piece of asphalt roofing felt. Cut out the outline using a utility knife. Fold the piece in half to form a small square.
Pry the roof shingle back where the nail is sticking out, using a scraper for help if necessary, leaving the asphalt roof liner exposed.
Pull the protruding nail out from the roof and reinstall it approximately an inch up from the prior location with a hammer.
Paint a layer of asphalt cement over the nail hole in the asphalt roof liner. Press the square of asphalt roofing felt into place over the cement. Lay the shingle back in place. If the nail hole went all the way through the shingle, place a dab of the asphalt cement in the hole and fill with granules of loose shingle, which you can often find in your gutter.