DRAG DROP - Drag and drop the steps from the left into the correct sequence on the right to describe how to use Git to maintain the current HEAD and revert back to a previous commit, while undoing all intermediate commits. Select and Place:
Step 1 --------- > git log (Show the log of commits)
Step 2 --------- > git reset hard 56e05fced (Revert to original “add”)
Step 3 --------- > git reset -–soft HEAD@{1} (Revert to previous git add)
Step 4 --------- > git commit -m “Revert to 56e05fced commit” (Commit the original Head)
Step 5 --------- > git status (Confirm status of log)
You alway want to check it a command was successful by checking the status.
This is incorrect. If you try this, git commit will tell you there's nothing to commit - because git reset --hard is exactly what is says -> go back in time to commit 56.
You need to first do git log to find the commit number (56...). Then you do git reset --hard 56 to go back to that commit (this will only reset your local branch, your remote if you have it is still at the commit you had at the beginning).
Then you do git reset --soft HEAD@{1} which will go back to where you were before git reset --hard BUT it will leave the files alone (how they were at 56). And at this point you can do git commit.
This last commit will be on top of what you had at the beginning but the files will be from 56. Which is what the commit says.
I agree with kayleen's opinion.
If you do as blezzo's solution, you can see the message "nothing to commit" in 5 step.
If I rewrite it according to Kylin’s opinion, it will as following.
1. git log
2. git reset --hard 56e05fced
3. git reset --soft HEAD@{1}
4. git status
5. git commit -m "Revert to 56e05fced commit"
For verification, you can check while making two commits.
git reset –hard f414f31
git reset –soft HEAD@{1}
git commit -m “Reverting to the state of the project at f414f31”
upvoted 2 times
...
This section is not available anymore. Please use the main Exam Page.350-901 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
wilie
Highly Voted 1 year, 3 months agoblezzzo
Highly Voted 3 years, 2 months agokayleen
2 years, 11 months agoJM_Lee
2 years, 9 months agokayleen
2 years, 11 months agodead_beef
2 years, 6 months agoadomes
Most Recent 6 months, 3 weeks agoadomes
6 months agobluesky2022
1 year, 3 months agophc1978
2 years, 5 months ago