Deprecated: get_the_author_email is deprecated since version 2.8.0! Use get_the_author_meta('email') instead. in /home/cloudber/public_html/wp-includes/functions.php on line 4713
git resetfrom the second commit & on-wards.
Committed wrong files and haven’t pushed the commit to remote server, if you wish to undo it, it can be done.
git commit -m "Committed wrong files" (1) git reset HEAD~ (2) << Modify files as necessary >> (3) git add . (4) git commit -c ORIG_HEAD (5)
- This is the wrong commit which you want to undo
- This leaves your working tree (the state of your files on disk) unchanged but undoes the commit and leaves the changes you committed unstaged (so they’ll appear as “Changes not staged for commit” in git status and you’ll need to add them again before committing). If you only want to add more changes to the previous commit, or change the commit message, you could use
git reset --soft HEAD~instead, which is like
git reset HEAD~but leaves your existing changes staged.
- Make corrections to working tree files.
git addanything that you want to include in your new commit.
- Commit the changes, reusing the old commit message. reset copied the old head to
-c ORIG_HEADwill open an editor, which initially contains the log message from the old commit and allows you to edit it. If you do not need to edit the message, you could use the
Author: Wu Chia Chong
My main areas of interest are software architectures and software design methods, patterns, and new trends in software development.