When does Git refresh the list of remote branches?

Question

Using git branch --all shows all remote and local branches. When does Git refresh this list?

On pull/push? And how do I refresh it using Git Bash?

Answer

To update the local list of remote branches:

git remote update origin --prune

To show all local and remote branches that (local) Git knows about:

git branch -a

Undo a git stash

How do I exit from the text window in Git?