Remove the trim from the edges of the floor with a hammer and pry bar to expose the space between the perimeter of the floor and the wall. Keep the trim intact as you remove it.
Loosen the course of floorboards along the wall on the side of the floor that's closest to the damaged planks. Remove the course by pushing and wiggling the boards by hand into the space along the wall. As you separate the boards, leave them sitting in the same configuration they were in when they were connected.
Loosen the next course of flooring then the next in the same manner, leaving each board sitting where it was after you get it loose from the boards around it. Work your way out to the boards that need to be replaced.
Remove the damaged boards. Put the replacement boards in their place, snapping them along their edges to the surrounding boards.
Reassemble the floor, putting the rest of the boards back together. Build your way toward the wall, re-setting the boards in the same position they were in.
Put the floor trim back into place with a trim nailer, hiding the spaces around the perimeter.