Write $N=10b+a$ where $b$ has exactly $n$ digits, ($10^{n-1}\le b<10^n$) and $a$ is a digit. Then $N'=10^na+b$. We want that
$$10br+ar=10^na+b$$
That is
$$\frac ba=\frac{10^n-r}{10r-1}$$
The RHS meets these values, for the first values of $r$:
$$\frac{99\ldots98}{19}, \frac{99\ldots97}{29}, \frac{99\ldots96}{39},
\frac{99\ldots95}{49},\cdots$$
(Each numerator has $n-1$ nines).
You must find, for each value of $r$, some value of $n$ such that the corresponding fraction can be simplified, yielding an one-digit denominator and an $n$-digits numerator. Then $10^n-r$ and $10r-1$ must have a common divisor $d$ such that
$$\frac{10r-1}9\le d\le\frac{10^n-r}{10^{n-1}}$$
From the second inequality we get $r\le 10^n-d\cdot10^{n-1}$, which implies $d\le 9$. Put this in the first inequality to get $r\le 8$.The only value of $10r-1$ that has appropiate divisors is $49$, because the other are primes, $3\cdot 13$ and $3\cdot 23$ ($3$ is too small in these cases). Thus, $r=5$.
We find that $99995$ is a multiple of $7$, so for $r=n=5$ we get the smallest possible solution, which turns to be $142857$. ($99995/49=14285/7$).
Remark: If it is allowed to write zeroes at the left of $N$, then the upper bound for $d$ dissapears, and we can get other solutions, like $N=052631578947368421$ or $N=0344827586206896551724137931$.