This is a good example of Spontaneous Recovery. The Spontaneous Recovery occurs when we learn a behavior, in this case, fear the dogs, then learned not to fear, producing a process known as the extinction of behavior. But when the behavior reappears spontaneous recovery occurs, that is, fear of dogs reappears.
I hope my answer can help you.