Unless it was a bluff charge which is very, very common with grizzlies.
If it is a for real charge (and a grizzly cause black bears can climb) about the only chance is if you have a tree close by to scramble up…..
I had a friend who was a backcountry fly fishing guide out of West Yellowstone, he had been “treed” by grizzlies a few times….the weird thing is once he was safely up the tree the bear would leave the scene in a hurry (he always thought it was adrenaline)….