[SOLVED] Error: pathspec 'origin/master' did not match any file(s) known to git (bench version 4 issue)

If you encountered above error or your bench is not updating, then there is (temporary) issue I recently discovered, it can be manually fixed with following commands on your self-hosted Frappe/ERPNext server.
Switching -> origin/develop to -> origin/master fixes error.

frappe@param01:~$ cd .bench/
frappe@param01:~/.bench$ git status
On branch develop
Your branch is up-to-date with 'origin/develop'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   .gitignore
	modified:   .travis.yml
	modified:   LICENSE.md
	modified:   MANIFEST.in
	modified:   bench/__init__.py
	modified:   bench/cli.py
	modified:   bench/commands/config.py
	modified:   bench/commands/setup.py
	modified:   bench/commands/utils.py
	modified:   bench/config/__init__.py
	modified:   bench/config/common_site_config.py
	modified:   bench/config/nginx.py
	modified:   bench/config/redis.py
	modified:   bench/config/site_config.py
	modified:   bench/config/supervisor.py
	modified:   bench/config/templates/502.html
	modified:   bench/config/templates/Procfile
	modified:   bench/config/templates/frappe_sudoers
	modified:   bench/config/templates/nginx.conf
	modified:   bench/config/templates/nginx_default.conf
	modified:   bench/config/templates/redis_cache.conf
	modified:   bench/config/templates/redis_queue.conf
	modified:   bench/config/templates/redis_socketio.conf
	modified:   bench/config/templates/supervisor.conf
	modified:   bench/patches/__init__.py
	modified:   bench/patches/patches.txt
	modified:   bench/patches/v3/__init__.py
	modified:   bench/patches/v3/celery_to_rq.py
	modified:   bench/patches/v3/deprecate_old_config.py
	modified:   bench/patches/v3/redis_bind_ip.py
	modified:   bench/tests/__init__.py
	modified:   bench/tests/test_setup_production.py
	modified:   completion.sh
	modified:   install_scripts/contrib-apps.json
	modified:   install_scripts/erpnext-apps-master.json
	modified:   install_scripts/erpnext-apps.json
	modified:   installer/playbooks/install_dependencies.yml
	modified:   installer/playbooks/roles/bash_screen_wall/files/screen_wall.sh
	modified:   installer/playbooks/roles/bash_screen_wall/tasks/main.yml
	modified:   installer/playbooks/roles/dns_caching/handlers/main.yml
	modified:   installer/playbooks/roles/dns_caching/tasks/main.yml
	modified:   installer/playbooks/roles/epel/README.md
	modified:   installer/playbooks/roles/epel/defaults/main.yml
	modified:   installer/playbooks/roles/epel/meta/main.yml
	modified:   installer/playbooks/roles/epel/tasks/main.yml
	modified:   installer/playbooks/roles/fail2ban/defaults/main.yml
	modified:   installer/playbooks/roles/fail2ban/handlers/main.yml
	modified:   installer/playbooks/roles/fail2ban/tasks/main.yml
	modified:   installer/playbooks/roles/fail2ban/templates/nginx-proxy-filter.conf.j2
	modified:   installer/playbooks/roles/fail2ban/templates/nginx-proxy-jail.conf.j2
	modified:   installer/playbooks/roles/frappe_selinux/files/frappe_selinux.te
	modified:   installer/playbooks/roles/frappe_selinux/tasks/main.yml
	modified:   installer/playbooks/roles/locale/defaults/main.yml
	modified:   installer/playbooks/roles/locale/tasks/main.yml
	modified:   installer/playbooks/roles/logwatch/defaults/main.yml
	modified:   installer/playbooks/roles/logwatch/tasks/main.yml
	modified:   installer/playbooks/roles/logwatch/templates/logwatch.conf.j2
	modified:   installer/playbooks/roles/mariadb/README.md
	modified:   installer/playbooks/roles/mariadb/defaults/main.yml
	modified:   installer/playbooks/roles/mariadb/handlers/main.yml
	modified:   installer/playbooks/roles/mariadb/meta/main.yml
	modified:   installer/playbooks/roles/mariadb/tasks/centos.yml
	modified:   installer/playbooks/roles/mariadb/tasks/main.yml
	modified:   installer/playbooks/roles/mariadb/tasks/mysql_secure_installation.yml
	modified:   installer/playbooks/roles/mariadb/tasks/ubuntu.yml
	modified:   installer/playbooks/roles/mariadb/templates/mariadb_centos.repo.j2
	modified:   installer/playbooks/roles/mariadb/templates/mariadb_ubuntu.list.j2
	modified:   installer/playbooks/roles/mariadb/templates/my.cnf.j2
	modified:   installer/playbooks/roles/mariadb/vars/main.yml
	modified:   installer/playbooks/roles/nginx/.travis.yml
	modified:   installer/playbooks/roles/nginx/README.md
	modified:   installer/playbooks/roles/nginx/defaults/main.yml
	modified:   installer/playbooks/roles/nginx/handlers/main.yml
	modified:   installer/playbooks/roles/nginx/meta/main.yml
	modified:   installer/playbooks/roles/nginx/tasks/main.yml
	modified:   installer/playbooks/roles/nginx/tasks/setup-Debian.yml
	modified:   installer/playbooks/roles/nginx/tasks/setup-RedHat.yml
	modified:   installer/playbooks/roles/nginx/tasks/vhosts.yml
	modified:   installer/playbooks/roles/nginx/templates/nginx.conf.j2
	modified:   installer/playbooks/roles/nginx/templates/nginx.repo.j2
	modified:   installer/playbooks/roles/nginx/templates/vhosts.j2
	modified:   installer/playbooks/roles/nginx/tests/inventory
	modified:   installer/playbooks/roles/nginx/tests/test.yml
	modified:   installer/playbooks/roles/nginx/vars/Debian.yml
	modified:   installer/playbooks/roles/nginx/vars/RedHat.yml
	modified:   installer/playbooks/roles/ntpd/tasks/main.yml
	modified:   installer/playbooks/roles/swap/defaults/main.yml
	modified:   installer/playbooks/roles/swap/tasks/main.yml
	modified:   installer/playbooks/roles/wkhtmltopdf/defaults/main.yml
	modified:   installer/playbooks/roles/wkhtmltopdf/tasks/main.yml
	modified:   installer/playbooks/templates/mariadb_config.cnf
	modified:   installer/playbooks/templates/nginx.conf
	modified:   playbooks/__init__.py
	modified:   playbooks/develop/centos.yml
	modified:   playbooks/develop/create_user.yml
	modified:   playbooks/develop/includes/mariadb_centos.yml
	modified:   playbooks/develop/includes/mariadb_ubuntu.yml
	modified:   playbooks/develop/includes/setup_bench.yml
	modified:   playbooks/develop/includes/setup_dev_env.yml
	modified:   playbooks/develop/includes/setup_mariadb.yml
	modified:   playbooks/develop/includes/setup_selinux_policy.yml
	modified:   playbooks/develop/includes/wkhtmltopdf_centos.yml
	modified:   playbooks/develop/includes/wkhtmltopdf_ubuntu_debian.yml
	modified:   playbooks/develop/install.yml
	modified:   playbooks/develop/macosx.yml
	modified:   playbooks/develop/templates/mariadb_centos.repo
	modified:   playbooks/develop/templates/simple_mariadb_config.cnf
	modified:   playbooks/develop/ubuntu.yml
	modified:   playbooks/install.py
	modified:   playbooks/production/includes/setup_bench_production.yml
	modified:   playbooks/production/includes/setup_prod_env.yml
	modified:   playbooks/production/install.yml
	modified:   playbooks/production/templates/default_nginx.j2
	modified:   playbooks/production/templates/frappe_selinux.te
	modified:   requirements.txt
	modified:   setup.py
	modified:   vm/Readme.md
	modified:   vm/ansible/base.yml
	modified:   vm/ansible/library/bench.py
	modified:   vm/ansible/roles/mariadb/README.md
	modified:   vm/ansible/roles/mariadb/defaults/main.yml
	modified:   vm/ansible/roles/mariadb/handlers/main.yml
	modified:   vm/ansible/roles/mariadb/meta/main.yml
	modified:   vm/ansible/roles/mariadb/tasks/centos.yml
	modified:   vm/ansible/roles/mariadb/tasks/main.yml
	modified:   vm/ansible/roles/mariadb/tasks/mysql_secure_installation.yml
	modified:   vm/ansible/roles/mariadb/tasks/ubuntu.yml
	modified:   vm/ansible/roles/mariadb/templates/mariadb_centos.repo.j2
	modified:   vm/ansible/roles/mariadb/templates/mariadb_ubuntu.list.j2
	modified:   vm/ansible/roles/mariadb/templates/my.cnf.j2
	modified:   vm/ansible/roles/mariadb/vars/main.yml
	modified:   vm/ansible/roles/nginx/.travis.yml
	modified:   vm/ansible/roles/nginx/README.md
	modified:   vm/ansible/roles/nginx/defaults/main.yml
	modified:   vm/ansible/roles/nginx/handlers/main.yml
	modified:   vm/ansible/roles/nginx/meta/main.yml
	modified:   vm/ansible/roles/nginx/tasks/main.yml
	modified:   vm/ansible/roles/nginx/tasks/setup-Debian.yml
	modified:   vm/ansible/roles/nginx/tasks/setup-RedHat.yml
	modified:   vm/ansible/roles/nginx/tasks/vhosts.yml
	modified:   vm/ansible/roles/nginx/templates/nginx.conf.j2
	modified:   vm/ansible/roles/nginx/templates/nginx.repo.j2
	modified:   vm/ansible/roles/nginx/templates/vhosts.j2
	modified:   vm/ansible/roles/nginx/tests/inventory
	modified:   vm/ansible/roles/nginx/tests/test.yml
	modified:   vm/ansible/roles/nginx/vars/Debian.yml
	modified:   vm/ansible/roles/nginx/vars/RedHat.yml
	modified:   vm/ansible/roles/swap/defaults/main.yml
	modified:   vm/ansible/roles/swap/tasks/main.yml
	modified:   vm/ansible/roles/wkhtmltopdf/defaults/main.yml
	modified:   vm/ansible/roles/wkhtmltopdf/tasks/main.yml
	modified:   vm/ansible/templates/mariadb_config.cnf
	modified:   vm/ansible/templates/nginx.conf
	modified:   vm/ansible/vars.yml
	modified:   vm/ansible/vm.yml
	modified:   vm/ansible/vm_vars/all.yml
	modified:   vm/build.py
	modified:   vm/scripts/install_ansible.sh
	modified:   vm/scripts/set_message.sh
	modified:   vm/scripts/zerofree.sh
	modified:   vm/vm.json

no changes added to commit (use "git add" and/or "git commit -a")
frappe@param01:~/.bench$ git branch -a
* develop
  remotes/origin/develop
frappe@param01:~/.bench$ git remote add origin https://github.com/frappe/bench.git
fatal: remote origin already exists.
frappe@param01:~/.bench$ git fetch
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 4 (delta 3), reused 4 (delta 3), pack-reused 0
Unpacking objects: 100% (4/4), done.
From https://github.com/frappe/bench
   452c12d..daabbd8  develop    -> origin/develop
frappe@param01:~/.bench$ git pull origin master
remote: Counting objects: 28, done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 28 (delta 19), reused 15 (delta 6), pack-reused 0
Unpacking objects: 100% (28/28), done.
From https://github.com/frappe/bench
 * branch            master     -> FETCH_HEAD
Updating 452c12d..0f0a01e
Fast-forward
 README.md                         | 4 ++--
 bench/config/lets_encrypt.py      | 4 ++--
 bench/config/templates/nginx.conf | 1 -
 bench/patches/__init__.py         | 8 ++++++++
 bench/utils.py                    | 9 +++++++--
 playbooks/install.py              | 2 +-
 6 files changed, 20 insertions(+), 8 deletions(-)
 mode change 100644 => 100755 playbooks/install.py
frappe@param01:~/.bench$ cd ..
frappe@param01:~$ cd ..
frappe@param01:~/frappe-bench$  bench update --upgrade

Ta-da!