Let us take this as the complete problem domain of the question:
I have a single branch named develop. I have around 20 commits in it. I want to squash all of them in to one commit, and rename it to "Initial commit". So at the end, the branch will have one commit named "Initial commit".
You are wishing that the most recent n commits were one commit. I call this the first type of regret. The first type of regret is cured by doing a soft reset and a commit. Here's a demonstration. First, I'll make a bunch of commits on a develop branch:
git init
echo "one" > file
git add .
git commit -m "one"
git branch develop
git checkout develop
echo "two" >> file
git add .
git commit -m "two"
echo "three" >> file
git add .
git commit -m "three"
echo "four" >> file
git add .
git commit -m "four"
echo "five" >> file
git add .
git commit -m "five"
git log --oneline
# 2febafe (HEAD -> develop) five
# 363ca9f four
# 429b266 three
# d46e6df two
# b8bf284 (master) one
cat file
# one
# two
# three
# four
# five
As you can see, I've got commits two, three, four, and five on develop. I wish those were just one commit. Here we go:
git reset --soft b8bf284
git add .
git commit -m "unified"
Okay, let's look around:
git log --oneline
# 408bdd1 (HEAD -> develop) unified
# b8bf284 (master) one
cat file
# one
# two
# three
# four
# five
Yup, there is now just one commit on develop after the point where it diverged from master, and everything I did (all five lines of the file) is in it.