Pull up on the carpet in one corner of the room. Slowly peel back the carpet along one wall and fold it back toward the middle of the room. You will need sufficient space for working between the carpet and the wall.
Remove the old tack strips using a hammer and pry bar. While these should come out easily, you need to be careful, as these are sharp and dangerous.
Place new tack strips where the old ones were located. You should be able to line these up fairly easily using the old marks along the floor.
Install new carpet padding if necessary around the new tack strips. This prevents the carpet from coming into direct contact with the subfloor. Staple the padding to the floor so it does not move when you stretch the carpet.
Stretch the carpet with a power stretcher. Place one end against the wall where you did not pull up the carpet. Stretch the carpet in a fan pattern working from the middle of the room out, attaching the carpet to the new tack strips as you go along.
Cut any excess carpet from the wall and tuck the carpet edge beneath the baseboard.