This sounds a bit weird. When I change a file in a directory, that file's IPFS hash will be different, when I add it to the IPFS, same with the parent hash (the directory's hash). I always run
ipfs pin rm on both the previous file's hash and the directory's old hash, then I run
ipfs add on the new file and the whole directory, then
ipfs pin add on both. (Don't know if the
pin add command is necessary, but I do it just to be sure.) At any rate, if you access the website on localhost using the new parent hash, it should then show the new version.