Git · Junior · Question 51 of 75

What does git reset --soft HEAD~1 do?

Explanation

The branch moves back one commit while the index and files stay as they were. It's a quick way to redo a commit, for example to split it.

Further reading

Problem with a question

Git · Junior · question 51

Test yourself

Take the Git · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz