Q:

Revert classfile changes without changing the class?

I am trying to add dots between the sections and the pages in my table of contents without using the package tocloft, since it moved my title from its original position. Right now it looks like this:

I have found that if I comment the following line from my .cls file, I get the desired output.
\let\@dottedtocline\@plaintocline

Here's what the desired ouytput looks like:

I would like to leave the .cls file untouched, as I understand it is best practice. 
So how can I suppress the effect of that line from my .tex file, instead of modifying the class?
Here is the \@plaintocline command definition:
\def\@plaintocline#1#2#3#4#5{%
  \ifnum #1>\c@tocdepth \else
    \vskip \z@ \@plus.2\p@
    {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
     \parindent #2\relax\@afterindenttrue
     \interlinepenalty\@M
     \leavevmode
     \@tempdima #3\relax
     \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
     {#4}\nobreak
     \leaders\hbox{$\m@th
        \mkern \@dotsep mu\hbox{}\mkern \@dotsep
        mu$}\hfill
     \nobreak
     \hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}%
     \par}%
  \fi}

A:

I guess just adding:
\makeatletter
\def\@dottedtocline#1#2#3#4#5{%
  \ifnum #1>\c@tocdepth \else
    \vskip \z@ \@plus.2\p@
    {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
     \parindent #2\relax\@afterindenttrue
     \interlinepenalty\@M
     \leavevmode
     \@tempdima #3\relax
     \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
     {#4}\nobreak
     \leaders\hbox{$\m@th
        \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
        mu$}\hfill
     \nobreak
     \hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}%
     \par}%
  \fi}
\makeatother

to the preamble should work. This should redefine \@dottedtocline the way it was before the \let you mention, i.e. the lay the LaTeX core latex.ltx defines it. If you tell me what class you use, I might find an option that switches off that \let. Or maybe you can try reading the documentation for it…
Addenda

As you said, the manual mentions no option to reverse the change, saying instead:

A UFPEThesis não oferece nada em particular para a produção da bibliografia ou dos índices. Esse material deve ser criado da maneira usual discutida, por exemplo, em [1].

Or:

UFPEThesis offers nothing in particular for the production of the bibliography or of the indices. This material must be created in the usual manner discussed, for example, in [1].

As you notice, the only difference between the two tocline commands is the \hbox{.}, which is \hbox{} in the \@plaintocline macro. That is precisely what makes the dots. Basically (but I might be oversimplifying or getting things plain wrong), \leaders takes its argument and repeats it enough times to fill a line, so if it has nothing it puts nothing (\@plain), if it has a dot it puts a dot (\@dotted). You can have fun changing the contents of that \hbox and seeing strange things like:

Capitulo segundo * * * * * * * * * * * * * * * <pagenumber>

or:

Capitulo segundo foo foo foo foo foo foo foo foo foo <pagenumber>

if you like :).

A few more details about the command:

First it checks if the number given as #1 is greater than \c@tocdepth, so if subsubsections are not supposed to be in the toc and you start one it won't create a line. If it is not greater, then it goes into the \else branch;
There, it finds instructions to add vertical space, precisely a stretchable space in order to have some margin of stretchability to be able to avoid collapsing a page into the top section when the page is broken;
Then it opens a group;
Then we have some bookkeeping, more precisely some parameter changes;
After that bookkeeping, which goes on till \null and includes \leavevmode to start a line, we have a \nobreak forbidding a linebreak (we are at the start of the line after all), then we have a negative horizontal space (I wonder why negative), then #4 is printed, which should be the chapter title or similar;
After another \nobreak, we have the \leaders command, which contains \m@th, which is a spacing command I don't really know too much about, then a math space \mkern, the \hbox, and another \mkern; so the contents of the \hbox will be repeated surrounded by space; naturally, removing \mkern will reduce (or eliminate if you remove both \mkerns) the spacing around the dots/whatever is in the \hbox;
The \hfill strikes me as out of place, but I probably do not know how \leaders works; anyway after this a break is forbidden, and a box of the width of a \@pnumwidth (a parameter containing a width suitable for page numbers, I should think) is created and placed there, which contains precisely the page number;
\par, so new line, then close the group, then close the \else branch and the whole conditional with the \fi, and we are done.

