These are a list of some common GIT usage notes the developers of FreePBX have come across.

Remove Merged Local Branches

git branch --merged | egrep -v "(^\*|master|release|dev)" | xargs git branch -d


Remove Merged Remote Branches

git branch -r --merged | egrep -v "(^\*|master|release|dev)" | sed 's/origin\///' | xargs -n 1 git push --delete origin
git remote prune origin

Submodule Updating Recursive:

# Update the submodule URLs
git submodule foreach --recursive sync
# Update the submodule files
git submodule update --init --recursive 

Reverting Pushed Commits:

A single commit

# Find the commit you want to revert using 'git log' or 'git blame' and find the hash for that commit
git blame Performance.class.php | grep true
09098ae9 (Rob Thomas 2013-12-28 10:29:19 +1000  7)      public function On() { $this->doperf = true; }
# Make sure you want to revert the ENTIRE commit
git show 09098ae9
[..output of diff here..]
# If you're sure you want to revert the entire commit
git revert 09098ae9
# This will open up an editor, with the default saying you've reverted the commit. It would be nice if you could explain why. 

Note that if you're reverting a commit that has since been changed by a DIFFERENT commit, you will get conflicts and you'll need to manually resolve them. This is one of the (many) reasons why it's good to do a few small, easily compartmented changes per commit.

The last couple of commits were written when I was well past the Ballmer Peak, and should be thrown away for the good of humanity. So I'm just going to revert everything I've done for the past few commits. 

# reset the index to the desired tree
git reset 56e05fced
# move the branch pointer back to the previous HEAD
git reset --soft HEAD@{1}
git commit -m "Revert to 56e05fced"
# Update working copy to reflect the new commit
git reset --hard
# Update Remote
git push origin <branch>