Git · Middle · Question 56 of 75

What does git restore --source=HEAD~2 file.js do?

Explanation

Only the file changes; history and the branch stay. Commit the result if you want to keep the old version.

Further reading

Problem with a question

Git · Middle · question 56

Test yourself

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

Take this quiz