About 133,000 results
Open links in new tab
  1. How do I use 'git reset --hard HEAD' to revert to a previous commit?

    Mar 2, 2012 · I know that Git tracks changes I make to my application, and holds on to them until I commit the changes. To revert to a previous commit, I used: $ git reset --hard HEAD HEAD is …

  2. How do I undo 'git reset'? - Stack Overflow

    Mar 24, 2010 · My situation was slightly different, I did git reset HEAD~ three times. To undo it I had to do git reset HEAD@{3} so you should be able to do git reset HEAD@{N} But if you …

  3. How do I undo the most recent local commits in Git?

    I accidentally committed the wrong files to Git but haven't pushed the commit to the server yet. How do I undo those commits from the local repository?

  4. How do I revert all local changes in Git managed project to …

    Jul 18, 2009 · To revert changes made to your working copy, do this: git checkout . Or equivalently, for git version >= 2.23: git restore . To revert changes made to the index (i.e., that …

  5. In plain English, what does "git reset" do? - Stack Overflow

    git reset — mixed default/ same as git reset files remain in working directory — git reset — soft does not remove either tracked or untracked files, you can deal with these files manually either …

  6. What is difference between 'git reset --hard HEAD~1' and 'git …

    When using git reset --hard HEAD~1 you will lose all uncommited changes and all untracked files in addition to the changes introduced in the last commit. The changes won't stay in your …

  7. What is `git restore` and how is it different from `git reset`?

    Sep 19, 2019 · The git switch command is also new, introduced along with git restore in Git 2.23. It implements the "safe half" of git checkout; git restore implements the "unsafe half".

  8. Practical uses of git reset --soft? - Stack Overflow

    156 git reset is all about moving HEAD, and generally the branch ref. Question: what about the working tree and index? When employed with --soft, moves HEAD, most often updating the …

  9. What's the difference between git reset --mixed, --soft, and --hard?

    `git reset command`. But if the commits are confirmed to the remote repository then not recommended to use the reset command and we have to use the revert command to discard …

  10. Undo Git pull. How to bring repositories to the old state

    If there is a failed merge, which is the most common reason for wanting to undo a git pull, running git reset --merge does exactly what one would expect: keep the fetched files, but undo the …