Maybe your husband smelled hungry. Seriously, perhaps your dog was startled when just part of your husband poked up over the fence. Many dogs, when startled, choose retreat rather than attack. Another possibility is that he was barking at an evil stranger, but suddenly found out it was actually his beloved pack leader. He was embarrassed and wanted in so he could pretend it never happened.