Updated build.sh to properly reset the current branch while building documentation.