I committed sensitive data to a single file on my main
branch. I never pushed it. I can change HEAD to point to the previous commit with git reset HEAD^
, but the commit is still hanging around as git reflog
shows.
How can I use the reflog hash/ID, to COMPLETELY remove/delete that commit?
To remove a specific reflog entry, you can use:
This is documented here. For removing all reflog history, or history older than a certain date, see this question and answer.
Note, this removes the reflog entry only. For more information about completely removing the commit, see torek's answer.