The accepted answer is good but a bit difficult to follow. Here's the same answer but a bit sweeter.
As Tilman Vogel says, gists are just repositories and so this approach works for github repositories as well as gists.
Let's assume that there is just one version that contains a password that you don't want to show. You've checked in the new version with the password removed and want to get rid of the previous version. You should be able to adapt this process if there are a number of commits showing the password.
The first thing is that the repair has to be done on your local machine (not in github). To do this start by cloning the gist locally. The gist's page on github should show you how to create a private clone if you click on the private clone URL. Something like:
git clone git@gist.github.com:421xxx1.git gist-421xxx1
This gives you a local copy that you need to rebase (meaning muck around with the versions).
cd gist-421xxx1
git rebase -i eexxaa^
Where eeccaa is the (first) version containing the password. You can get this number from the gist page revisions column. The ^ is required. The command means 'let me change the verisons from eexxaa to the latest, interactively. The command opens up an editor populated with a command on each line for each version in the repo. The default command is 'pick' meaning 'use or keep this version'.
The first lines in the editor should look something like
pick eexxaa <- the version with the password
pick ffxxbb <- the first version without the password
Change this to
pick eexxaa
squash ffxxbb
I.e. Change the word 'pick' to 'squash' on the version without the password. This will ask the rebase to squash the new (passwordless) version into the old (password carrying) one, essentially deleting version eexxaa. Obviously your versions will be other than eexxaa or ffxxbb don't literally use eexxaa or ffxxbb anywhere!
As @kand notes, you should squash
every version that contained the password.
In the editor save and quit (if it's vi :x). The rebase should now open a new editor showing the commit messages for the two versions and asking for a single combined commit message. For a gist these messages are quite likely to be empty but you do need to put something in here or the rebase will abort. Type a message, save it and quit and the rebase should complete.
You now have a repository without the password-containing version. To get this back to the gist use:
git push -f
This will force the changes onto the github repo. Hit refresh and you should be able to check in the browser that the offending version has gone from the revisions column on the right hand side.
Thats it!