Pry off the floor trim around the edges of the floor using a hammer and flat bar to expose the 1/2-inch space between the floorboards and the wall. Preserve the trim as you remove it. Set aside the trim.
Determine which edge of the floor is closest to the damaged area. Use your hands to push the boards that are along that edge toward the wall, loosening them from the adjacent boards and pushing them into the 1/2-inch space. Don’t remove the boards; leave them loosely sitting in the same positions in which they were.
Repeat the process of loosening the board for the next course, again leaving them loosely in their positions. Work your way over the floor course by course, loosening each course. Continue until you get to the damaged boards.
Remove the damaged boards. Set new ones in their places, snapping them into position with the adjacent boards.
Reassemble the floor, building back out across the room in the opposite order as before until you get back to the starting wall.
Reinstall the floor trim with a finish nailer.