delete from history code example
Example 1: remove file history from git
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch path_to_file" HEAD
Example 2: delete command from history
Just check the enumeration of your commands history and then delete them:
history -d 7 #Deletes seventh command in your history list