0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ローカル環境で過去のコミットに戻す方法/【Render】特定のコミットをデプロイする方法

Last updated at Posted at 2025-05-17

「ローカル環境で」一時的に過去のコミットに戻す方法

VSCode ターミナルでコマンドを実行します。

git checkout コミットハッシュ

コミットハッシュは、(GitHubにpush済みなら)GitHubのコミット画面から戻したいコミットのSHAをコピーします。

注意
この時、未コミットのファイルが残っているとエラーになる。コミットするか、変更を削除する。

実際にはVSCodeのソース管理メニュー > 戻したいコミット > 右クリック > チェックアウト(デタッチ済) を実行した。

image.png

runserver して確認すると戻っています。

最新状態への戻し方

ソース管理メニュー > 変更 > チェックアウト先 > main を選択

image.png

image.png

「Renderで」特定のコミットをデプロイする方法

過去の特定のコミットをデプロイして、本番環境で見たいとき。

Render > dashboad > アプリ名 > Events > Manual Deploy > Deploy a specific commit(特定のコミットをデプロイ)

image.png

戻したいバージョンを選択してデプロイ。

参考

以下の記事を参考にさせていただきました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?