How I can modify the second last pushed commit using GIT, I need to delete some files from the mentioned commit, and I would like to preserve the last commit.
What I did so far:
git reset --soft HEAD^
git reset --soft HEAD^ # two times
git reset HEAD .idea/ # and the same for other directories
git add -A
git commit --amend