Hands-on task
This task is step 12 of the course “Everyday Git”
Undo a commit while keeping changes staged
In the repository /root/repo there are two commits: first (added file1.txt) and second (added file2.txt). Undo the last commit so that HEAD points at first again, but the changes from second (the file file2.txt) stay staged for commit (in the index). The file file2.txt must remain on disk.
Reference:git
What you'll practise:
- git
- git reset
- --soft
- index
- HEAD~1