Clean up tangled code with small, tested changes.
Recent revisions are kept. Restoring one creates a new revision.