There is a little bit of confusion in the terms: "HEAD" is not the same thing as "head" or "tip". "HEAD" refers to the currently checked out branch.
Anyway. :)
If you really want to throw away everything you've done and return your master to an exact copy of trunk, that's very simple. Assuming that master is checked out:
git reset --hard trunk
Warning: reset --hard destroys uncommitted changes.
If you want to do advanced salvation of previous work, let me give you a very, very brief introduction to one of git's numerous safety belts: the reflog. For example, if you say
git log -g master
you'll see a list of, well, "savepoints" for master. We call this the reflog in git land. Whenever an operation changes a branch, it prepends a new savepoint to the top of that branch's reflog. In other words, if the last operation you did horribly messed up your branch, you can return your branch to what it was immediately before that operation:
git reset --hard master@{1}
That @{1}
will make more sense once you look at a reflog. git also supports more flashy syntax, like @{10.minutes.ago}
.
Many more things are possible, but this should be enough to get things fixed up for now.