Solution-
A regular octagon has 8 equal angles and 8 equal sides.
When rotating an octagon around its center, 1/8th of a full-circle rotation will cause adjacent sides to coincide on each other.
A circle has 360° and (1/8)th of 360° = 45°.
Hence, a minimum of 45° rotation counterclockwise or clockwise(as it is symmetric so the order doesn't matter) puts each of the edges over the position where an adjacent edge was located before.