Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

git-checkout

How do I revert all local changes in Git managed project to previous state?

August 26, 2022 by Tarik

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 you have added), do this. Warning this will reset all of your unpushed commits to master!: git reset To revert a change that … Read more

Categories git Tags git, git-checkout, revert Leave a comment

How do I find and restore a deleted file in a Git repository?

August 23, 2022 by Tarik

Find the last commit that affected the given path. As the file isn’t in the HEAD commit, that previous commit must have deleted it. git rev-list -n 1 HEAD — <file_path> Then checkout the version at the commit before, using the caret (^) symbol: git checkout <deleting_commit>^ — <file_path> Or in one command, if $file … Read more

Categories git Tags file-io, git, git-checkout Leave a comment
Newer posts
← Previous Page1 … Page9 Page10

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa