in the toolbar under the 3d view theres a button which brings up a menu, you may choose either “normal”, “global”, “local”, or “view”.
normal: aligns the handlebars such that +Z points directly perpendicular and away from the selected face(s)
global: aligns the handlebars precisely along the global axis
local: aligns the handlebars with the rotation of the object
view: aligns the handlebars to your view (obviously) in which +Z is pointing at you, +Y is up, and +X is to the right. (works best in orthographic mode)
If i understand your question correctly, normal is your best bet.
tip: experiment. if what you just did isn’t what you want, use Ctrl+Z to undo, and try something else. i have learned a LOT from that.
hope that helps!