Full information can be found in this post:
How to move HEAD back to a previous location? (Detached head)
The best option is to do something which is not desrivbed there,
git reset HEAD --mixed HEAD^3
It will checkout the 3rd commit and use the above post to continue working from this point on.
Follow the checkout as its described there:
git checkout
git checkout <commit_id>
git checkout -b <new branch> <commit_id>
git checkout HEAD~X // x is the number of commits t go back
This will checkout new branch pointing to the desired commit.
This command will checkout to a given commit.
At this point you can create a branch and start to work from this point on.
# Checkout a given commit.
# Doing so will result in a `detached HEAD` which mean that the `HEAD`
# is not pointing to the latest so you will need to checkout branch
#in order to be able to update the code.
git checkout <commit-id>
# create a new branch forked to the given commit
git checkout -b <branch name>
In order to do a git squash follow those steps:
// X is the number of commits you wish to squash, in your case 6
git rebase -i HEAD~X
Once you squash your commits - choose the e
for edit the commit.

If you just want to remove big files from the repo use this:
You should use this tool:
https://rtyley.github.io/bfg-repo-cleaner/
It the prefect tool for this kind of task
BFG Repo-Cleaner
an alternative to git-filter-branch.
The BFG is a simpler, faster alternative to git-filter-branch for cleansing bad data out of your Git repository history:
- Removing Crazy Big Files
- Removing Passwords, Credentials & other Private data
Examples (from the official site)
In all these examples bfg is an alias for java -jar bfg.jar.
# Delete all files named 'id_rsa' or 'id_dsa' :
bfg --delete-files id_{dsa,rsa} my-repo.git