in Technology by

What does the command git reset –hard HEAD ~3 do?

       A. Merges the last 3 commits to the master

       B. Discards the last 3 commits

       C. Does nothing

       D. Resets the head to 3 commits before the current commit

1 Answer

0 votes
by

What does the command git reset –hard HEAD ~3 do?

       Ans : Discards the last 3 commits

Related questions

0 votes
    I have made some changes to a file that has been committed a few times as part of a group of files, but ... former state in the past Select the correct answer from above options...
asked Jan 31, 2022 in Education by JackTerrance
0 votes
    What does the command Git reset –- soft HEAD^ perform? A. Moves commit to one after current head B. Moves commit ... . Moves commit to the first head D. None of the options...
asked Dec 21, 2022 in Education by JackTerrance
0 votes
    What is the Git command to view the last three commits in a line? A. git last 3 commits B. git log -–oneline -3 C. git show log -3 D. git log...
asked Dec 23, 2022 in Technology by JackTerrance
0 votes
    What is the significance of using –index in the git stash pop – – index command? A. To commit the ... To index the files staged D. To pull the staged changes...
asked Dec 23, 2022 in Technology by JackTerrance
0 votes
    Recently, I have been asked to cherry-pick a commit. So what does cherry-picking a commit in git mean? How do you do it? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I created a local branch that I want to 'push' upstream. There is a similar question here on Stack ... the upstream repository? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I would prefer to write my commit messages in Vim, but it is opening them in Emacs. How do I configure Git ... for a single project. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I've been wondering whether there is a good "git export" solution that creates a copy of a tree without the . ... tree into the index. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    How do I discard changes in my working copy that are not in the index? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    How do I revert from my current state to a snapshot made on a certain commit? If I do git log, then I get ... , i.e. commit 0d1d7fc? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I don't want to rename a remote branch, as described in the Rename master branch for both local and remote ... and remote branch name Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I have a project consisting of a huge amount of data. Because of its size, I can't use a remote GIT repo and push/pull ... -ProjectGit | | |-objects |-project1 | |-refs | |-.git...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    As asked in this question, I also want to know how to resolve a conflicting git stash pop without ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    I have used "traditional" version control systems to maintain source code repositories on past projects. I ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 15, 2022 in Education by JackTerrance
0 votes
    I only recently added a .gitignore file to ignore some specific data files in a subdirectory of mine. I ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 25, 2022 in Education by JackTerrance
...