A shingle that has lifted from the roof can simply be re-nailed down; seal the nails with roofing cement. Repair a split shingle by closing the gap between the two pieces, nailing them to the roof deck, and sealing the crack and nail heads with roofing cement.
Cracked, warped, missing, or broken shingles are not something to repair. Instead, they should be replaced. Here’s how:
1) With a hammer and chisel, split the defective shingle along the wood grain, and pull out as many pieces of the shingle as you can.
2) Slide a flat bar up under the shingle, and force out the nails with a few hammer blows. (Or, for a neater job, you can cut off the nails, using a hacksaw blade or a special shingle ripper, available at hardware stores or roofing supply companies). Take care to not damage the roofing material beneath the shingles.
3) Cut a replacement shingle to fit the space, making it 1/2 inch narrower than the space (with 1/4-inch clearance on each side so the wood can expand with moisture changes).

4) Tap the replacement into place with a hammer, stopping about 1/4 inch before it is flush with its neighbors and leaving 1/4 inch on either side of the shingle.
5) Drive two roofing nails just below the butt of the shingle above it, angled slightly upward. Then place a wood block against the replacement, and tap it upward the final 1/4 inch.