The current UI allows to switch branches while viewing a tree or file.
Of course, there is no guarantee that the same tree or file will be present in the other branch one switches to, see for example:
vs
Currently, the UI shows an error message:
Directory entry with path arch/arm/kernel/xscale-cp0.c from e4660ac807d16a7bd3af6db2dfce539acd94ba23 not found
While this error message is perfecly sound, we might want to give a more informative one to the user, and possibly going back to the previous page.