What is right way to add new Branch to a Tree?

I have a file f1.root with a Tree “mytree” with one Branch "Branch1"
How can I add a new branch to this Tree in this file?

I use

[code]TFile *f1 = new TFile(“data.root”, “update”);

TTree tree = (TTree)f1->Get(“mytree”);

TBranch *br;

br = tree->Branch(“Branch2”,&A,"…");

tree -> Write(“mytree”);

But when I run it once more it creates an additional Branch2;2 in a Tree.
I need to overwrite it.
How can I do it?

simply call br->Fill() for each existing entry (Tree.GetEntries) of your Tree.