how to revert back to previous commit in git
//Git Rollback to a specific commit via Mac terminal
//Navigate to project and open git log
cd projectname
git log --oneline
//Locate and checkout the desired commit ID
git checkout abc1234 .
//(Type q to quit the git log)
//Stage All changes, commit with comment, and push to remote
git add -A
git commit -m "Revert commit: abc1234"
git push# This will destroy any local modifications.
# Don't do it if you have uncommitted work you want to keep.
git reset --hard 0d1d7fc32
# Alternatively, if there's work to keep:
git stash
git reset --hard 0d1d7fc32
git stash pop
# This saves the modifications, then reapplies that patch after resetting.
# You could get merge conflicts, if you've modified things which were
# changed since the commit you reset to.
Also in Shell:
- how to install vue in laravel
- pyinstaller statsmodels
- git remove folder form past all commits
- shell script variable
- ufw allow port
- git add commit in one command
- how to create a shortcut ubuntu
- How do I get a complete list of all table names in all databases in Hive?
- how to connect to the database as root user in linux
- upgrade node version
- why i am not able to paste anything in htdocs folder in ubuntu
- cordova ios emulators
- remove frmo staging git
- isdigit in c
- bash permissions
- create next js app
- could not connect to server: Connection refused Is the server running on host and accepting TCP/IP connections on port 5432?
- install linuxbrew
- pod install ruby: bad interpreter: No such file or directory
- list all users linux
- vim compare 2 files
- docker compose run
- how to insert a delimiter into an array powershell
- undercover mode kali