** Emacs now supports "selective undo" which undoes only within a
specified region. To do this, set point and mark around the desired region and type C-u C-x u (or C-u C-_). You can then continue undoing further, within the same region, by repeating the ordinary undo command C-x u or C-_. This will keep undoing changes that were made within the region you originally specified, until either all of them are undone, or it encounters a change which crosses the edge of that region.

In Transient Mark mode, undoing when a region is active requests selective undo.