I'm having some trouble understanding when to "go back" while using Dijkstra's algorithm. For example:
When I tried to solve this, all went fine until I arrived at E (I did ABE). Going from E, G = [12+9 = 21], C = [12+10 = 22], H remains unchanged because [12+10 = 22] > 6.
What I'd do next is choose G and then do this again and choose C and then J, but that gives me a distance of 28. In these solutions at some point my professor went back after getting to G and went to C... or something. Help me understand this?

Going from $A$->$B$->$E$ is already false. First, starting at $A$, you put $(B,5)$, $(H,6)$ and $(F,10)$ in your queue.
As B has a smaller distance, you next look at B and all its outgoing distances. Thus now you put $(E,12)$ and $(D,13)$ inside.
HOWEVER, as your next step you dont look at $E$, but at $H$, because it is your lowest distance in your queue.
Doing it like this guarantees you that you always look at a new node when the distance from start to it is as low as possible. Thus, when you reach your target, you know that this is the optimal path.