If you have made a mess (I'm still a terrible git noob) and have managed to abandon changes in gerrit that still have dependencies on them you can recover the situation by performing an interactive rebase:
# Get the remote changes (safe, does not merge)
git fetch origin

# Interactively rebase them
git rebase origin/master -i

# In your editor, pick the first change and squash the following changes
# (if you want a last-write-wins type of merge) and then save the file

# Create a new commit message and remove any old comments and change IDs
git commit --amend

# Push the changes to the origin
git push origin HEAD:refs/for/master